Move using yargs up the call stack

This commit is contained in:
Antonio Scandurra
2016-08-02 09:19:03 +02:00
parent a4c85673b8
commit 7f67966c00
2 changed files with 8 additions and 7 deletions

View File

@@ -5,6 +5,7 @@
// Needed so we can require src/module-cache.coffee during generateModuleCache
require('coffee-script/register')
const argv = require('yargs').argv
const cleanOutputDirectory = require('./lib/clean-output-directory')
const codeSign = require('./lib/code-sign')
const copyAssets = require('./lib/copy-assets')
@@ -31,4 +32,10 @@ generateMetadata()
writeFingerprint()
dumpSymbols()
.then(packageApplication)
.then(codeSign)
.then(packagedAppPath => {
if (argv.codeSign) {
codeSign(packagedAppPath)
} else {
console.log('Skipping code-signing. Specify --code-sign option to perform code-signing...')
}
})

View File

@@ -1,12 +1,6 @@
const argv = require('yargs').argv
const childProcess = require('child_process')
module.exports = function (packagedAppPath) {
if (!argv.codeSign) {
console.log('Skipping code-signing. Specify --code-sign option to perform code-signing...')
return
}
console.log(`Unlocking keychain ${process.env.ATOM_MAC_CODE_SIGNING_KEYCHAIN}`)
childProcess.spawnSync('security', [
'unlock-keychain',