diff --git a/build/build.js b/build/build.js index e51c75aa0..e884d6643 100755 --- a/build/build.js +++ b/build/build.js @@ -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...') + } + }) diff --git a/build/lib/code-sign.js b/build/lib/code-sign.js index 99dc32eb5..d6fe553ea 100644 --- a/build/lib/code-sign.js +++ b/build/lib/code-sign.js @@ -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',