Skip to content

Commit

Permalink
Update notarization script
Browse files Browse the repository at this point in the history
  • Loading branch information
alchaplinsky committed Feb 9, 2023
1 parent f438fa1 commit a0cdf43
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/notarize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require('dotenv').config()
const { spawn } = require('child_process')
const { notarize } = require('@electron/notarize')
const os = require('os')

Expand All @@ -9,17 +10,22 @@ exports.default = async function notarizing(context) {
return
}
const dir = os.arch() === 'arm64' ? 'mac-arm64' : 'mac'
const appPath = `packages/${dir}/Swifty.app`

try {
return await notarize({
appPath,
tool: process.env.NOTARIZE_TOOL,
teamId: process.env.APPLETEAMID,
appBundleId: 'com.electron.swifty',
appPath: `packages/${dir}/Swifty.app`,
appleId: process.env.APPLEID,
appleIdPassword: process.env.APPLEIDPASSWORD
})
} catch (error) {
console.log(error)
if (error.message.includes('Failed to staple')) {
spawn(`xcrun`, ['stapler', 'staple', appPath])
} else {
throw error
}
}
}

0 comments on commit a0cdf43

Please sign in to comment.