-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathafter-sign.js
30 lines (25 loc) · 810 Bytes
/
after-sign.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
exports.default = async function(context) {
// If we are not packaging for windows we don't sign here, just return
if (context.packager.platform.name !== 'windows') {
return;
}
// Make sure we don't leave an outdated electron.exe.sig laying about
if (context.packager.appInfo.productFilename !== 'electron') {
var fs = require("fs");
var path = context.appOutDir + '/electron.exe.sig'
if (fs.existsSync(path)) {
fs.unlinkSync(path)
}
}
// Sign the application package
var spawnSync = require("child_process").spawnSync;
var vmp = spawnSync('python', [
'-m', 'castlabs_evs.vmp', 'sign-pkg', 'dist/win-unpacked'
],
{
stdio: 'inherit'
});
if (vmp.status != 0) {
throw new Error('vmp-resign.py failed with code: ' + vmp.status);
}
}