-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbuild-authoring-tool.js
More file actions
26 lines (23 loc) · 913 Bytes
/
build-authoring-tool.js
File metadata and controls
26 lines (23 loc) · 913 Bytes
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
// replace version string in ensembletool/package.json with updated version string
// (passed as first CLI argument)
if (process.argv[2]) {
const version = process.argv[2];
const packageFilePath = "ensembletool/package.json";
const fs = require("fs");
const oldContents = fs.readFileSync(packageFilePath, "utf8");
const newContents = oldContents.replace(/"version": "[^"]+"/, `"version": "${version}"`);
fs.writeFileSync(packageFilePath, newContents);
}
const packager = require("electron-packager");
async function bundleElectronApp(options) {
const appPaths = await packager(options);
console.log(`Electron app bundles created:\n${appPaths.join("\n")}`);
};
bundleElectronApp({
// options as specified in https://github.com/electron/electron-packager/blob/master/docs/api.md
arch: "ia32,x64",
dir: "ensembletool",
platform: "darwin,win32,linux",
out: "build",
overwrite: true
});