mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-10 06:20:13 +00:00
fix(shell): escape ! for cmd.exe delayed expansion
Adds defensive escaping for exclamation marks in case delayed expansion is enabled in the user's cmd.exe environment.
This commit is contained in:
@@ -75,5 +75,10 @@ describe('escapeShellArg', () => {
|
||||
const { escapeShellArg } = await import('../../../src/utils/shell-executor');
|
||||
expect(escapeShellArg('C:\\Program Files\\App')).toBe('"C:\\Program Files\\App"');
|
||||
});
|
||||
|
||||
it('escapes exclamation marks for delayed expansion', async () => {
|
||||
const { escapeShellArg } = await import('../../../src/utils/shell-executor');
|
||||
expect(escapeShellArg('hello!')).toBe('"hello^^!"');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user