summary refs log tree commit diff
path: root/bundle/scripts
diff options
context:
space:
mode:
authorThe Arcane Brony <myrainbowdash949@gmail.com>2021-10-22 09:26:01 +0200
committerThe Arcane Brony <myrainbowdash949@gmail.com>2021-11-11 22:24:44 +0100
commit06456cf7275fb2ad7141d91c7c7611e04f532277 (patch)
tree6bf9b0495d1f8f089d18134d49de8a90b0b9fa73 /bundle/scripts
parentAdd plugin & css support, add styling to differentiate from discord.com (diff)
downloadserver-06456cf7275fb2ad7141d91c7c7611e04f532277.tar.xz
Global prettierrc, format build.js
Diffstat (limited to 'bundle/scripts')
-rw-r--r--bundle/scripts/build.js73
1 files changed, 28 insertions, 45 deletions
diff --git a/bundle/scripts/build.js b/bundle/scripts/build.js
index c00c2eaa..549e340f 100644
--- a/bundle/scripts/build.js
+++ b/bundle/scripts/build.js
@@ -9,57 +9,40 @@ 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")
-);
-fse.copySync(
-  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")
-);
+fse.copySync(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"));
+fse.copySync(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("Copying src files done");
 if (!argv.includes("copyonly")) {
-  console.log("Compiling src files ...");
+	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"
+			}
+		)
+	);
 }