Skip to content

Commit 04e96bc

Browse files
Potential fix for code scanning alert no. 20: Incomplete string escaping or encoding
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 3880c00 commit 04e96bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/utils/src/lib/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export type CliArgsObject<T extends object = Record<string, ArgumentValue>> =
1616
export function escapeCliArgs(args: string[]): string[] {
1717
return args.map(arg => {
1818
if (arg.includes(' ') || arg.includes('"') || arg.includes("'")) {
19-
return `"${arg.replace(/"/g, '\\"')}"`;
19+
return `"${arg.replace(/\\/g, '\\\\').replace(/"/g, '\\"')}"`;
2020
}
2121
return arg;
2222
});

0 commit comments

Comments
 (0)