mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-15 03:04:37 +03:00
26 lines
768 B
CoffeeScript
26 lines
768 B
CoffeeScript
module.exports = (grunt) ->
|
|
{spawn} = require('./task-helpers')(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'
|
|
{XCODE_KEYCHAIN_PASSWORD, XCODE_KEYCHAIN} = process.env
|
|
args = ['unlock-keychain', '-p', XCODE_KEYCHAIN_PASSWORD, 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) -> callback(error)
|