From 5e86d7ab9c5200d794c3adb2b422d20a2aefd2ce Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Sat, 13 Aug 2022 02:00:50 +0200 Subject: restructure to single project --- bundle/scripts/utils.js | 54 ------------------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 bundle/scripts/utils.js (limited to 'bundle/scripts/utils.js') diff --git a/bundle/scripts/utils.js b/bundle/scripts/utils.js deleted file mode 100644 index f4b1ad7f..00000000 --- a/bundle/scripts/utils.js +++ /dev/null @@ -1,54 +0,0 @@ -const path = require("path"); -const fs = require("fs"); -const { env } = require("process"); -const { execSync } = require("child_process"); -const { argv, stdout, exit } = require("process"); - -const parts = ["api", "util", "cdn", "gateway", "bundle"]; - -function copyRecursiveSync(src, dest) { - //if (verbose) console.log(`cpsync: ${src} -> ${dest}`); - let exists = fs.existsSync(src); - if (!exists) { - console.log(src + " doesn't exist, not copying!"); - return; - } - let stats = exists && fs.statSync(src); - let isDirectory = exists && stats.isDirectory(); - if (isDirectory) { - fs.mkdirSync(dest, { recursive: true }); - fs.readdirSync(src).forEach(function (childItemName) { - copyRecursiveSync( - path.join(src, childItemName), - path.join(dest, childItemName) - ); - }); - } else { - fs.copyFileSync(src, dest); - } -} - -function execIn(cmd, workdir, opts) { - try { - return execSync(cmd, { - cwd: workdir, - shell: true, - env: process.env, - encoding: "utf-8", - ...opts - }); - } catch (error) { - return error.stdout; - } -} - -function getLines(output) { - return output.split("\n").length; -} - -module.exports = { - //consts - parts, - //functions - copyRecursiveSync, execIn, getLines -}; -- cgit 1.5.1