Skip to content

Commit 9a53b66

Browse files
authored
Merge pull request #3795 from skoeva/replace-execsync
app/scripts/esrp.js: Replace execSync with execFileSync
2 parents 0609d63 + 77664f6 commit 9a53b66

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app/scripts/esrp.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
**/
77

88
const crypto = require('crypto');
9-
const { execSync } = require('child_process');
9+
const { execFileSync } = require('child_process');
1010
const path = require('path');
1111
const os = require('os');
1212
const fs = require('fs');
@@ -218,7 +218,17 @@ function sign(esrpTool, op, pathToSign) {
218218
fs.writeFileSync(authJson, JSON.stringify(AUTH_JSON, undefined, 2));
219219

220220
try {
221-
execSync(`${esrpTool} Sign -l Verbose -a ${authJson} -p ${policyJson} -i ${signInputJson}`);
221+
execFileSync(esrpTool, [
222+
'Sign',
223+
'-l',
224+
'Verbose',
225+
'-a',
226+
authJson,
227+
'-p',
228+
policyJson,
229+
'-i',
230+
signInputJson,
231+
]);
222232
} catch (e) {
223233
console.error('Failed to sign:', e);
224234
process.exit(e.status !== null ? e.status ?? 1 : 1);

0 commit comments

Comments
 (0)