From 60e69e382635a376c7562a08ea5166a168d98216 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Dec 2024 12:26:20 +0000 Subject: [PATCH] [AUTO]Update CJS script Files changed: M dist/index.js M src/index.js --- dist/index.js | 10 ++++------ src/index.js | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/index.js b/dist/index.js index 35aaf34..4f8d4ba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27314,10 +27314,6 @@ const workspacePath = process.env.GITHUB_WORKSPACE; const options = core.getMultilineInput("options"); const path = core.getInput("path"); -const sanitizeArgument = (arg) => { - return arg.replace(/\\"/g, '"'); -}; - let repoError; let platformError; @@ -27335,11 +27331,13 @@ async function run() { const workspaceNotEmpty = (await fs.readdir(workspacePath)).length > 0; if (workspaceExists && workspaceNotEmpty) { - const sanitizedOptions = options.map(sanitizeArgument); + const escapedOptions = options.map((str) => + str.replace(/(["'])/g, "\\$1"), + ); execFile( `${process.env["ProgramFiles(x86)"]}\\Inno Setup 6\\iscc.exe`, - [...sanitizedOptions, `${workspacePath}\\${path}`], + [...escapedOptions, `${workspacePath}\\${path}`], (execError, stdout, stderr) => { console.log(stdout); if (execError) { diff --git a/src/index.js b/src/index.js index cf4a44e..42bdd72 100644 --- a/src/index.js +++ b/src/index.js @@ -23,7 +23,9 @@ async function run() { const workspaceNotEmpty = (await fs.readdir(workspacePath)).length > 0; if (workspaceExists && workspaceNotEmpty) { - const escapedOptions = options.map(str => str.replace(/(["'])/g, '\\$1')); + const escapedOptions = options.map((str) => + str.replace(/(["'])/g, "\\$1"), + ); execFile( `${process.env["ProgramFiles(x86)"]}\\Inno Setup 6\\iscc.exe`,