-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.js
More file actions
42 lines (34 loc) · 1.18 KB
/
Copy pathbuild.js
File metadata and controls
42 lines (34 loc) · 1.18 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
/**
* Build script for LyricDisplay NDI™ Companion.
*
* Uses electron-builder to produce platform-specific .zip archives
* that the main LyricDisplay app downloads and extracts automatically.
*
* Usage:
* node build.js Build for the current platform and arch
* node build.js --win --x64 Build for Windows x64
* node build.js --mac --arm64 Build for macOS arm64
* node build.js --linux --x64 Build for Linux x64
*/
import { execSync } from 'child_process';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
function run(command) {
execSync(command, { cwd: __dirname, stdio: 'inherit' });
}
function main() {
const extraArgs = process.argv.slice(2).join(' ');
console.log('LyricDisplay NDI Companion — Build');
console.log(`Platform: ${process.platform} (${process.arch})`);
if (extraArgs) {
console.log(`Extra args: ${extraArgs}`);
}
console.log('');
const cmd = `npx electron-builder ${extraArgs} --publish never`.trim();
run(cmd);
console.log('');
console.log('Build complete. Archives are in dist/');
}
main();