Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/core/src/utils/shell-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ describe('escapeShellArg', () => {

it('should handle empty strings', () => {
const result = escapeShellArg('', 'bash');
expect(result).toBe('');
expect(result).toBe("''");
expect(mockQuote).not.toHaveBeenCalled();
});
});
Expand All @@ -339,7 +339,7 @@ describe('escapeShellArg', () => {

it('should handle empty strings', () => {
const result = escapeShellArg('', 'cmd');
expect(result).toBe('');
expect(result).toBe('""');
});
});

Expand All @@ -361,7 +361,7 @@ describe('escapeShellArg', () => {

it('should handle empty strings', () => {
const result = escapeShellArg('', 'powershell');
expect(result).toBe('');
expect(result).toBe("''");
});
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/utils/shell-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export const isWindows = () => os.platform() === 'win32';
* @returns The shell-escaped string.
*/
export function escapeShellArg(arg: string, shell: ShellType): string {
if (!arg) {
return '';
if (arg === '') {
return shell === 'cmd' ? '""' : "''";
}

switch (shell) {
Expand Down