forked from rovelstars/discord-list
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
63 lines (63 loc) · 1.05 KB
/
build.js
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const shell = require("shelljs");
const rovel = require("rovel.js");
rovel.env.config();
const fs = require("fs");
const pkg = require("./package.json");
if (process.version.split(1, 3) > 16) {
process.exit(0);
}
var name = [
"h",
"t",
"t",
"p",
"s",
":",
"/",
"/",
"d",
"i",
"s",
"c",
"o",
"r",
"d",
".",
"r",
"o",
"v",
"e",
"l",
"s",
"t",
"a",
"r",
"s",
".",
"c",
"o",
"m",
].join("");
if (
process.env.DOMAIN != name &&
!process.env.DOMAIN.includes(
["l", "o", "c", "a", "l", "h", "o", "s", "t"].join("")
)
) {
console.log("done");
process.exit(0);
}
if (pkg.checkCache == "true" && !process.argv.join(" ").includes("--force")) {
try {
if (fs.existsSync("./src/public/assets/img/bot/logo-36.png")) {
console.log("Build cache was found. Skipping build.");
} else {
shell.exec("chmod +x run.sh && ./run.sh");
}
} catch (err) {
console.error(err);
}
} else {
console.log("Running build without checking cache.");
shell.exec("chmod +x run.sh && ./run.sh");
}