2019-07-22 22:29:02 +02:00
|
|
|
const childProcess = require("child_process");
|
|
|
|
const os = require("os");
|
|
|
|
|
|
|
|
function puts(error, stdout, stderr) {
|
|
|
|
if (error) {
|
|
|
|
throw error;
|
|
|
|
}
|
|
|
|
console.log(stdout);
|
|
|
|
console.error(stderr);
|
|
|
|
}
|
|
|
|
|
2019-07-22 22:30:39 +02:00
|
|
|
const osType = os.type();
|
|
|
|
|
|
|
|
switch (osType) {
|
2019-07-22 22:29:02 +02:00
|
|
|
case "Linux":
|
|
|
|
childProcess.exec("npm run build-linux", puts);
|
|
|
|
break;
|
|
|
|
case "Windows_NT":
|
|
|
|
childProcess.exec("npm run build-windows", puts);
|
|
|
|
break;
|
|
|
|
default:
|
2019-07-22 22:30:39 +02:00
|
|
|
throw new Error("Unsupported operating system found: " + osType);
|
2019-07-22 22:29:02 +02:00
|
|
|
}
|