This repository has been archived by the owner on May 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforge.config.js
57 lines (56 loc) · 1.5 KB
/
forge.config.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
47
48
49
50
51
52
53
54
55
56
57
const { promisify } = require("util");
const exec = promisify(require("child_process").exec);
module.exports = {
packagerConfig: {
icon: "./resources/app.ico",
},
makers: [
{
name: "@electron-forge/maker-zip",
},
],
plugins: [
[
"@electron-forge/plugin-webpack",
{
mainConfig: "./webpack.main.config.js",
renderer: {
config: "./webpack.renderer.config.js",
entryPoints: [
{
html: "./src/index.html",
js: "./src/renderer.ts",
name: "main_window",
preload: {
js: "./src/preload.ts",
},
},
],
},
},
],
],
hooks: {
postPackage: async (forgeConfig, options) => {
if (!process.env.CASTLABS_EVS_USER) {
if (options.spinner)
options.spinner.fail("EVS signing cancelled - user not specified!");
} else if (!process.env.CASTLABS_EVS_PASSWORD) {
if (options.spinner)
options.spinner.fail(
"EVS signing cancelled - password not specified!"
);
} else {
await exec(
`python -m castlabs_evs.account -n refresh -A ${process.env.CASTLABS_EVS_USER} -P ${process.env.CASTLABS_EVS_PASSWORD}`
);
await exec(
`python -m castlabs_evs.vmp -n sign-pkg "${options.outputPaths[0]}"`
);
if (options.spinner) {
options.spinner.succeed("EVS signing succeeded!");
}
}
},
},
};