diff options
author | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-12-21 20:49:58 +0000 |
---|---|---|
committer | The Arcane Brony <myrainbowdash949@gmail.com> | 2021-12-21 21:49:58 +0100 |
commit | cbd337701f5d1364df1bc774b8ed55fc07029b10 (patch) | |
tree | 9c1ba2b15fc8a2a2b6d36506a1bd610d2b37b951 /bundle/scripts/build.js | |
parent | Repo cleanup, remove fs-extras (diff) | |
download | server-cbd337701f5d1364df1bc774b8ed55fc07029b10.tar.xz |
Improve build scripts, strip more fs-extras
Diffstat (limited to 'bundle/scripts/build.js')
-rw-r--r-- | bundle/scripts/build.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundle/scripts/build.js b/bundle/scripts/build.js index 4f56694c..f73fb11a 100644 --- a/bundle/scripts/build.js +++ b/bundle/scripts/build.js @@ -1,10 +1,12 @@ const { execSync } = require("child_process"); const path = require("path"); -const fse = require("fs-extra"); const fs = require("fs"); const { getSystemErrorMap } = require("util"); const { argv } = require("process"); +var steps = 2, i = 0; +if (argv.includes("clean")) steps++; +if (argv.includes("copyonly")) steps--; const dirs = ["api", "util", "cdn", "gateway", "bundle"]; const verbose = argv.includes("verbose") || argv.includes("v"); @@ -30,6 +32,7 @@ var copyRecursiveSync = function(src, dest) { }; if (argv.includes("clean")) { + console.log(`[${++i}/${steps}] Cleaning...`); dirs.forEach((a) => { var d = "../" + a + "/dist"; if (fs.existsSync(d)) { @@ -39,6 +42,7 @@ if (argv.includes("clean")) { }); } +console.log(`[${++i}/${steps}] Copying src files...`); copyRecursiveSync(path.join(__dirname, "..", "..", "api", "assets"), path.join(__dirname, "..", "dist", "api", "assets")); copyRecursiveSync(path.join(__dirname, "..", "..", "api", "client_test"), path.join(__dirname, "..", "dist", "api", "client_test")); copyRecursiveSync(path.join(__dirname, "..", "..", "api", "locales"), path.join(__dirname, "..", "dist", "api", "locales")); @@ -47,9 +51,8 @@ dirs.forEach((a) => { if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`); }); -console.log("[1/2] Copying src files done"); if (!argv.includes("copyonly")) { - console.log("[2/2] Compiling src files ..."); + console.log(`[${++i}/${steps}] Compiling src files ...`); console.log( execSync( |