-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron.js
46 lines (42 loc) · 992 Bytes
/
electron.js
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
var fs = require("fs");
var ncp = require("ncp").ncp;
var packager = require("electron-packager");
var process = require("process");
var opts = {
arch: "all",
dir: "build/electron",
platform: "all",
out: "build",
overwrite: "true",
version: "0.37.1"
};
var packageJson = require("./package.json");
var electronPackageJson = {
main: "main.js",
name: packageJson.name,
version: packageJson.version
};
ncp("build/html", "build/electron", function(err) {
if (err) {
console.error(err);
process.exit(1);
}
ncp("electron", "build/electron", function(err) {
if (err) {
console.error(err);
process.exit(2);
}
fs.writeFile("build/electron/package.json", JSON.stringify(electronPackageJson), function(err) {
if (err) {
console.error(err);
process.exit(3);
}
packager(opts, function done(err) {
if (err) {
console.error(err);
process.exit(4);
}
});
});
});
});