From 1585e370d39426038cd4e87feba9ac8834644d9b Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 6 Mar 2020 14:55:14 +0000 Subject: [PATCH] It's options.options in the original so keep it that way --- scripts/electron_winSign.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/electron_winSign.js b/scripts/electron_winSign.js index e18a2c3..51bfd3b 100644 --- a/scripts/electron_winSign.js +++ b/scripts/electron_winSign.js @@ -2,16 +2,16 @@ const { execFile } = require('child_process'); const path = require('path'); // Loosely based on computeSignToolArgs from app-builder-lib/src/codeSign/windowsCodeSign.ts -function computeSignToolArgs(options, keyContainer, inputFile) { +function computeSignToolArgs(options, keyContainer) { const args = []; if (process.env.ELECTRON_BUILDER_OFFLINE !== "true") { - const timestampingServiceUrl = options.timeStampServer || "http://timestamp.digicert.com"; + const timestampingServiceUrl = options.options.timeStampServer || "http://timestamp.digicert.com"; args.push(options.isNest || options.hash === "sha256" ? "/tr" : "/t", options.isNest || options.hash === "sha256" ? (options.options.rfc3161TimeStampServer || "http://timestamp.comodoca.com/rfc3161") : timestampingServiceUrl); } // We simplify and just specify the certificate subject name for our purposes - args.push('/n', options.certificateSubjectName); + args.push('/n', options.options.certificateSubjectName); args.push('/kc', keyContainer); if (options.hash !== "sha1") { @@ -29,12 +29,12 @@ function computeSignToolArgs(options, keyContainer, inputFile) { // https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610 args.push("/debug") // must be last argument - args.push(inputFile) + args.push(options.path) return args; } -exports.default = async function(cfg) { +exports.default = async function(options) { const keyContainer = process.env.SIGNING_KEY_CONTAINER; if (keyContainer === undefined) { console.warn( @@ -46,11 +46,11 @@ exports.default = async function(cfg) { return; } - const inPath = cfg.path; + const inPath = options.path; const appOutDir = path.dirname(inPath); return new Promise((resolve, reject) => { - const args = ['sign'].concat(computeSignToolArgs(cfg.options, keyContainer, cfg.path)); + const args = ['sign'].concat(computeSignToolArgs(options, keyContainer)); console.log("Running signtool with args", args); execFile('signtool', args, {}, (error, stdout) => {