I have an after-sign module which handles notarization.
I want to execute it only when building mac app.
My package.json is like this.
"scripts": {
"build:mac": "node .electron-vue/build.js && electron-builder --mac",
"build:win": "node .electron-vue/build.js && electron-builder --win --x64 --ia32",
},
"build": {
"mac": {
"hardenedRuntime": true,
"entitlements": "./notarlization/entitlement.plist",
"entitlementsInherit": "./notarlization/entitlement.plist"
},
"afterSign": "./notarlization/after-sign.js"
}
And my after-sign module is like this.
module.exports = async () => {
if (process.platform === 'darwin') {
console.log(`公証通過申請中...`)
try {
await notarize({
appBundleId,
appPath,
appleId,
appleIdPassword,
ascProvider
})
console.log('公証通過完了')
} catch (error) {
console.log('公証通過失敗: ', error)
}
}
}
Actually, it works fine.
Because I build mac app in macOS and Win app in WinOS.
But I think if (process.platform === 'darwin') {}
is not kool.
I want to do something like this in package.json.
Any one know how to do this?