summary refs log tree commit diff
path: root/bundle
diff options
context:
space:
mode:
authorThe Arcane Brony <myrainbowdash949@gmail.com>2021-10-20 17:54:54 +0200
committerThe Arcane Brony <myrainbowdash949@gmail.com>2021-11-11 22:24:03 +0100
commited133380fbc74ef3b6930d1ea125205ffe2e36fc (patch)
tree9f0b79ee81e120f7c710a2dc04476eb95d05231c /bundle
parentMerge pull request #496 from fosscord/translation (diff)
downloadserver-ed133380fbc74ef3b6930d1ea125205ffe2e36fc.tar.xz
Add plugin & css support, add styling to differentiate from discord.com
Diffstat (limited to 'bundle')
-rw-r--r--bundle/scripts/build.js84
1 files changed, 42 insertions, 42 deletions
diff --git a/bundle/scripts/build.js b/bundle/scripts/build.js
index affd7892..c00c2eaa 100644
--- a/bundle/scripts/build.js
+++ b/bundle/scripts/build.js
@@ -9,57 +9,57 @@ const dirs = ["api", "util", "cdn", "gateway", "bundle"];
 const verbose = argv.includes("verbose") || argv.includes("v");
 
 if (argv.includes("clean")) {
-	dirs.forEach((a) => {
-		var d = "../" + a + "/dist";
-		if (fse.existsSync(d)) {
-			fse.rmSync(d, { recursive: true });
-			if (verbose) console.log(`Deleted ${d}!`);
-		}
-	});
+  dirs.forEach((a) => {
+    var d = "../" + a + "/dist";
+    if (fse.existsSync(d)) {
+      fse.rmSync(d, { recursive: true });
+      if (verbose) console.log(`Deleted ${d}!`);
+    }
+  });
 }
 
 fse.copySync(
-	path.join(__dirname, "..", "..", "api", "assets"),
-	path.join(__dirname, "..", "dist", "api", "assets")
+  path.join(__dirname, "..", "..", "api", "assets"),
+  path.join(__dirname, "..", "dist", "api", "assets")
 );
 fse.copySync(
-	path.join(__dirname, "..", "..", "api", "client_test"),
-	path.join(__dirname, "..", "dist", "api", "client_test")
+  path.join(__dirname, "..", "..", "api", "client_test"),
+  path.join(__dirname, "..", "dist", "api", "client_test")
 );
 fse.copySync(
-	path.join(__dirname, "..", "..", "api", "locales"),
-	path.join(__dirname, "..", "dist", "api", "locales")
+  path.join(__dirname, "..", "..", "api", "locales"),
+  path.join(__dirname, "..", "dist", "api", "locales")
 );
 dirs.forEach((a) => {
-	fse.copySync("../" + a + "/src", "dist/" + a + "/src");
-	if (verbose)
-		console.log(
-			`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`
-		);
+  fse.copySync("../" + a + "/src", "dist/" + a + "/src");
+  if (verbose)
+    console.log(`Copied ${"../" + a + "/dist"} -> ${"dist/" + a + "/src"}!`);
 });
 
-console.log("[1/2] Copying src files done");
-console.log("[2/2] Compiling src files ...");
+console.log("Copying src files done");
+if (!argv.includes("copyonly")) {
+  console.log("Compiling src files ...");
 
-console.log(
-	execSync(
-		'node "' +
-			path.join(
-				__dirname,
-				"..",
-				"node_modules",
-				"typescript",
-				"lib",
-				"tsc.js"
-			) +
-			'" -p "' +
-			path.join(__dirname, "..") +
-			'"',
-		{
-			cwd: path.join(__dirname, ".."),
-			shell: true,
-			env: process.env,
-			encoding: "utf8",
-		}
-	)
-);
+  console.log(
+    execSync(
+      'node "' +
+        path.join(
+          __dirname,
+          "..",
+          "node_modules",
+          "typescript",
+          "lib",
+          "tsc.js"
+        ) +
+        '" -p "' +
+        path.join(__dirname, "..") +
+        '"',
+      {
+        cwd: path.join(__dirname, ".."),
+        shell: true,
+        env: process.env,
+        encoding: "utf8",
+      }
+    )
+  );
+}