Skip to content

Commit 654611e

Browse files
author
Test
committed
fix: escape script arguments without lint violations
Change-Id: Ide55a3d786a4fe73f340dea89dc604037ef2a122 Signed-off-by: Test <test@example.com>
1 parent c706378 commit 654611e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/node/services/ipcMain.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,12 @@ export class IpcMain {
12771277
);
12781278
}
12791279

1280-
const escapedArgs = args.map((arg) => `"${arg.replace(/"/g, '\"')}"`).join(" ");
1280+
const escapedArgs = args
1281+
.map((arg) => {
1282+
const safeArg = arg.replace(/"/g, '\\"');
1283+
return `"${safeArg}"`;
1284+
})
1285+
.join(" ");
12811286
const command = `"${scriptPath}"${escapedArgs ? ` ${escapedArgs}` : ""}`;
12821287

12831288
const bashTool = createBashTool({

0 commit comments

Comments
 (0)