summary refs log tree commit diff
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-06 15:34:05 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-06 15:34:05 +0200
commit8691dbfbaea96f645df190c9cc25d1ece5f2e694 (patch)
treec9afc6ff4f708fb4c3ebbfb6a4a754375cc50d4e
parentUpdate gitignore, push correct version of build script (diff)
downloadserver-8691dbfbaea96f645df190c9cc25d1ece5f2e694.tar.xz
Make build script use parts, defined in utils.js
-rw-r--r--bundle/scripts/build.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/bundle/scripts/build.js b/bundle/scripts/build.js
index 1a12ae73..f53a2223 100644
--- a/bundle/scripts/build.js
+++ b/bundle/scripts/build.js
@@ -3,7 +3,7 @@ const path = require("path");
 const fs = require("fs");
 const { getSystemErrorMap } = require("util");
 const { argv, stdout, exit } = require("process");
-const {copyRecursiveSync,execIn} = require('./utils');
+const { copyRecursiveSync, execIn, parts } = require('./utils');
 
 if(argv.includes("help")) {
 	console.log(`Fosscord build script help:
@@ -20,7 +20,6 @@ Arguments:
 let steps = 3, 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");
 const logerr = argv.includes("logerrors");
@@ -31,7 +30,7 @@ if(silent) console.error = console.log = function(){}
 
 if (argv.includes("clean")) {
 	console.log(`[${++i}/${steps}] Cleaning...`);
-	dirs.forEach((a) => {
+	parts.forEach((a) => {
 		let d = "../" + a + "/dist";
 		if (fs.existsSync(d)) {
 			fs.rmSync(d, { recursive: true });
@@ -49,7 +48,7 @@ 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"));
-dirs.forEach((a) => {
+parts.forEach((a) => {
 	copyRecursiveSync("../" + a + "/src", "dist/" + a + "/src");
 	if (verbose) console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
 });