forked from lostdesign/linked
-
Notifications
You must be signed in to change notification settings - Fork 0
/
afterSignHook.js
41 lines (33 loc) · 903 Bytes
/
afterSignHook.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
// "afterSign": "./afterSignHook.js",
require('dotenv').config()
const fs = require('fs')
const path = require('path')
var electron_notarize = require('electron-notarize')
module.exports = async function(params) {
if (process.platform !== 'darwin') {
return
}
console.log('afterSign hook triggered', params)
let appId = 'design.lost.linked'
let appPath = path.join(
params.appOutDir,
`${params.packager.appInfo.productFilename}.app`
)
if (!fs.existsSync(appPath)) {
console.log('skip')
return
}
console.log(`Notarizing ${appId} found at ${appPath}`)
try {
await electron_notarize.notarize({
appBundleId: appId,
appPath: appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD
})
} catch (error) {
console.error(error)
process.exit(1)
}
console.log(`Done notarizing ${appId}`)
}