From 096a828e44395d79a49b8d876f0937fdf61d8db2 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 26 Feb 2020 11:54:20 +0000 Subject: [PATCH] Change Windows signing to warning when missing token This allows Windows builds to complete when the singing token is not present. --- scripts/electron_afterSign.js | 7 +++--- scripts/electron_winSign.js | 40 +++++++++++++++++++++-------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/scripts/electron_afterSign.js b/scripts/electron_afterSign.js index e98ebde6..0aeedb73 100644 --- a/scripts/electron_afterSign.js +++ b/scripts/electron_afterSign.js @@ -11,9 +11,10 @@ exports.default = async function(context) { const userId = process.env.NOTARIZE_APPLE_ID; if (userId === undefined) { console.warn( - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + - "! Skipping notarisation: User ID not found, set NOTARIZE_APPLE_ID. !\n" + - "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + + "! Skipping macOS notarisation. !\n" + + "! User ID not found, set NOTARIZE_APPLE_ID. !\n" + + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", ); return; } diff --git a/scripts/electron_winSign.js b/scripts/electron_winSign.js index d55b8528..65aa6a07 100644 --- a/scripts/electron_winSign.js +++ b/scripts/electron_winSign.js @@ -8,23 +8,31 @@ exports.default = async function(options) { const appOutDir = path.dirname(inPath); // get the token passphrase from the keychain - const tokenPassphrase = await new Promise((resolve, reject) => { - execFile( - 'security', - ['find-generic-password', '-s', 'riot_signing_token', '-w'], - {}, - (err, stdout) => { - if (err) { - console.error("Couldn't find signing token in keychain", err); - // electron-builder seems to print '[object Object]' on the - // console whether you reject with an Error or a string... - reject(err); - } else { - resolve(stdout.trim()); - } - }, + let tokenPassphrase; + try { + tokenPassphrase = await new Promise((resolve, reject) => { + execFile( + 'security', + ['find-generic-password', '-s', 'riot_signing_token', '-w'], + {}, + (err, stdout) => { + if (err) { + reject(err); + } else { + resolve(stdout.trim()); + } + }, + ); + }); + } catch (err) { + console.warn( + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" + + "! Skipping Windows signing. !\n" + + "! Signing token not found in keychain. !\n" + + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!", ); - }); + return; + } return new Promise((resolve, reject) => { let cmdLine = 'osslsigncode sign ';