Format all files with prettier
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { execFile } = require('child_process');
|
||||
const { execFile } = require("child_process");
|
||||
|
||||
// Loosely based on computeSignToolArgs from app-builder-lib/src/codeSign/windowsCodeSign.ts
|
||||
function computeSignToolArgs(options, keyContainer) {
|
||||
@@ -8,15 +8,15 @@ function computeSignToolArgs(options, keyContainer) {
|
||||
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,
|
||||
options.isNest || options.hash === "sha256"
|
||||
? options.options.rfc3161TimeStampServer || "http://timestamp.comodoca.com/rfc3161"
|
||||
: timestampingServiceUrl,
|
||||
);
|
||||
}
|
||||
|
||||
args.push('/kc', keyContainer);
|
||||
args.push("/kc", keyContainer);
|
||||
// To use the hardware token (this should probably be less hardcoded)
|
||||
args.push('/csp', 'eToken Base Cryptographic Provider');
|
||||
args.push("/csp", "eToken Base Cryptographic Provider");
|
||||
// The certificate file. Somehow this appears to be the only way to specify
|
||||
// the cert that works. If you specify the subject name or hash, it will
|
||||
// say it can't associate the private key to the certificate.
|
||||
@@ -24,7 +24,7 @@ function computeSignToolArgs(options, keyContainer) {
|
||||
// so we don't have to hard-code this here
|
||||
// fwiw https://stackoverflow.com/questions/17927895/automate-extended-validation-ev-code-signing
|
||||
// is about the most useful resource on automating code signing...
|
||||
args.push('/f', 'element.io\\New_Vector_Ltd.pem');
|
||||
args.push("/f", "element.io\\New_Vector_Ltd.pem");
|
||||
|
||||
if (options.hash !== "sha1") {
|
||||
args.push("/fd", options.hash);
|
||||
@@ -35,7 +35,7 @@ function computeSignToolArgs(options, keyContainer) {
|
||||
|
||||
// msi does not support dual-signing
|
||||
if (options.isNest) {
|
||||
args.push("/as");
|
||||
args.push("/as");
|
||||
}
|
||||
|
||||
// https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610
|
||||
@@ -47,15 +47,15 @@ function computeSignToolArgs(options, keyContainer) {
|
||||
}
|
||||
|
||||
let warned = false;
|
||||
exports.default = async function(options) {
|
||||
exports.default = async function (options) {
|
||||
const keyContainer = process.env.SIGNING_KEY_CONTAINER;
|
||||
if (keyContainer === undefined) {
|
||||
if (!warned) {
|
||||
console.warn(
|
||||
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" +
|
||||
"! Skipping Windows signing. !\n" +
|
||||
"! SIGNING_KEY_CONTAINER not defined. !\n" +
|
||||
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
|
||||
"! Skipping Windows signing. !\n" +
|
||||
"! SIGNING_KEY_CONTAINER not defined. !\n" +
|
||||
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!",
|
||||
);
|
||||
warned = true;
|
||||
}
|
||||
@@ -63,9 +63,9 @@ exports.default = async function(options) {
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const args = ['sign'].concat(computeSignToolArgs(options, keyContainer));
|
||||
const args = ["sign"].concat(computeSignToolArgs(options, keyContainer));
|
||||
|
||||
execFile('signtool', args, {}, (error, stdout) => {
|
||||
execFile("signtool", args, {}, (error, stdout) => {
|
||||
if (error) {
|
||||
console.error("signtool failed with code " + error);
|
||||
reject("signtool failed with code " + error);
|
||||
|
||||
Reference in New Issue
Block a user