-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectron-builder.shared.cjs
More file actions
51 lines (41 loc) · 1.41 KB
/
Copy pathelectron-builder.shared.cjs
File metadata and controls
51 lines (41 loc) · 1.41 KB
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
// Mirror of src/shared/channel.ts for use by scripts/build-desktop-artifact.mjs.
// Keep field names identical to the TS module; src/shared/channel.config-parity.test.ts
// asserts they don't drift.
const CHANNELS = ["stable", "nightly"];
// Subdirectories under `dist/` that ship in the installer. A broad `dist/**/*`
// glob would sweep up stale `dist/win-unpacked` trees from prior packaging
// runs and recursively bloat the next installer.
const PACKAGED_DIST_DIRS = ["main", "renderer"];
const PACKAGED_DIST_FILES = PACKAGED_DIST_DIRS.flatMap((dir) => [
`dist/${dir}/**/*`,
`!dist/${dir}/**/*.map`,
]);
function normalizeChannel(value) {
return value === "nightly" ? "nightly" : "stable";
}
function productNameFor(channel) {
return channel === "nightly" ? "Lightcode Nightly" : "Lightcode";
}
function appIdFor(channel) {
return channel === "nightly" ? "com.lightcode.app.nightly" : "com.lightcode.app";
}
function userDataDirNameFor(channel) {
return channel === "nightly" ? ".lightcode-nightly" : ".lightcode";
}
function updaterChannelFor(channel) {
return channel === "nightly" ? "nightly" : undefined;
}
function artifactPrefixFor(channel) {
return channel === "nightly" ? "Lightcode-Nightly" : "Lightcode";
}
module.exports = {
CHANNELS,
PACKAGED_DIST_DIRS,
PACKAGED_DIST_FILES,
normalizeChannel,
productNameFor,
appIdFor,
userDataDirNameFor,
updaterChannelFor,
artifactPrefixFor,
};