-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.js
More file actions
38 lines (29 loc) · 918 Bytes
/
build.js
File metadata and controls
38 lines (29 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const buildLog = (msg) => {
console.log(`[build] ${msg}`);
};
let indent = " —";
buildLog("Starting build");
const shell = require("shelljs");
const manifest = {
source: "csxs/manifest.prod.xml",
target: "csxs/manifest.xml"
};
const outputDirectory ="build/";
const inputDirectories = [
"client",
"host",
"csxs",
];
// clean out previous build, if applicable
buildLog(`Cleaning ${outputDirectory}`)
shell.rm("-R", outputDirectory);
buildLog(`Building...`)
shell.mkdir(outputDirectory);
inputDirectories.forEach(folder => {
buildLog(`${indent} Copying '${folder}'`);
shell.cp("-R", folder, `${outputDirectory}/${folder}`);
});
buildLog(`Using Production manifest`);
buildLog(`${indent} Rename: ${outputDirectory}${manifest.source} -> ${outputDirectory}${manifest.target}`);
shell.mv(`${outputDirectory}${manifest.source}`, `${outputDirectory}${manifest.target}`);
buildLog(`Build complete.`);