Unlock keychain before signing

This commit is contained in:
Kevin Sawicki 2014-01-14 10:41:49 -08:00
parent f4b82fe3a4
commit 7a41fabf60

View File

@ -3,6 +3,22 @@ module.exports = (grunt) ->
grunt.registerTask 'codesign', 'Codesign the app', ->
done = @async()
if process.env.XCODE_KEYCHAIN
unlockKeychain (error) ->
if error?
done(error)
else
signApp(done)
else
signApp(done)
unlockKeychain = (callback) ->
cmd = 'security'
args = ['-p', process.env.XCODE_KEYCHAIN_PASSWORD, process.env.XCODE_KEYCHAIN]
spawn {cmd, args}, (error) -> callback(error)
signApp = (callback) ->
cmd = 'codesign'
args = ['-f', '-v', '-s', 'Developer ID Application: GitHub', grunt.config.get('atom.shellAppDir')]
spawn {cmd, args}, (error) -> done(error)