-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
62 lines (58 loc) · 1.43 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
const { existsSync, rmSync } = require("fs");
const { resolve, join } = require("path");
const builder = require("electron-builder");
// If the Electron app build folder exists, we need to delete it
if (existsSync(resolve("dist"))) {
rmSync(resolve("dist"), { recursive: true });
console.log('Removed "dist" directory');
}
// App build
console.log("Building setup...");
const config = {
appId: "com.github.1sheol.soundcloud-discord-rpc",
productName: "SCloud RPC",
mac: {
category: "public.app-category.music",
target: "dmg",
icon: join(__dirname, "/icons/icon.png"),
},
win: {
target: "nsis",
icon: join(__dirname, "/icons/icon.ico"),
},
linux: {
category: "Audio;AudioVideo",
target: ["snap", "AppImage", "deb"],
icon: join(__dirname, "/icons/icon.png"),
},
files: [
"main.js",
"preload.js",
],
};
const specifiedOS = process.argv[2];
if (specifiedOS) {
if (specifiedOS === "windows") {
config.mac = undefined;
config.linux = undefined;
} else if (specifiedOS === "macos") {
config.linux = undefined;
config.win = undefined;
} else if (specifiedOS === "linux") {
config.mac = undefined;
config.win = undefined;
}
} else {
if (process.platform === "win32") {
config.mac = undefined;
config.linux = undefined;
}
}
builder
.build({
config,
publish: "never",
})
.then(() => {
console.log('\nSetup built in the "dist" folder.');
});