👷 Add build script for Windows
This commit is contained in:
parent
fd67099a1a
commit
653b761eb6
2 changed files with 24 additions and 1 deletions
21
build.js
Normal file
21
build.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
const childProcess = require("child_process");
|
||||||
|
const os = require("os");
|
||||||
|
|
||||||
|
function puts(error, stdout, stderr) {
|
||||||
|
if (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
console.log(stdout);
|
||||||
|
console.error(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (os.type()) {
|
||||||
|
case "Linux":
|
||||||
|
childProcess.exec("npm run build-linux", puts);
|
||||||
|
break;
|
||||||
|
case "Windows_NT":
|
||||||
|
childProcess.exec("npm run build-windows", puts);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Error("Unsupported OS found: " + os.type());
|
||||||
|
}
|
|
@ -8,7 +8,9 @@
|
||||||
"url": "https://git.jedipedia.net/swtor/ssn.git"
|
"url": "https://git.jedipedia.net/swtor/ssn.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "gcc -Wall -m64 -o ssn-installer lib/miniz/miniz.c src/*.c src/*/*.c && chmod +x ssn-installer"
|
"preinstall": "npm run build-linux",
|
||||||
|
"build-linux": "gcc -Wall -m64 -o ssn-installer lib/miniz/miniz.c src/*.c src/*/*.c && chmod +x ssn-installer",
|
||||||
|
"build-windows": "gcc -Wall -m64 -std=c99 -o ssn-installer.exe lib/miniz/miniz.c src/*.c src/utils/decryptUtilities.c src/utils/fileUtilities.c"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"lib/miniz/miniz.h",
|
"lib/miniz/miniz.h",
|
||||||
|
|
Loading…
Reference in a new issue