-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
27 lines (23 loc) · 807 Bytes
/
build.js
File metadata and controls
27 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const { exec } = require("child_process");
const chalk = require("chalk");
const themeColors = {
text: "#2B2",
variable: "#42f5e0",
error: "#f5426c"
}
const main = () => {
console.log(chalk.hex(themeColors.text)("Starting build..."));
exec("npx tsc --project tsconfig.json", (err, stdout, stderr) => {
if (err) {
console.log(chalk.hex(themeColors.error)("Build failed with the following error: "));
console.log(chalk.hex(themeColors.error)(stdout));
return;
}
console.log(chalk.hex(themeColors.text)(`Build successful! You can start milo by running ${chalk.hex(themeColors.variable)("npm run milo")}\n`));
})
}
try {
main()
} catch (e) {
console.log(chalk.hex(themeColors.error)("Error: Something went wrong while trying to start the build process.", e))
}