fix(coding-agent): avoid cmd.exe for git installs on windows closes #3642
This commit is contained in:
@@ -460,6 +460,20 @@ Content`,
|
||||
});
|
||||
});
|
||||
|
||||
describe("windows command spawning", () => {
|
||||
it("should avoid the shell for git so Windows paths with spaces stay single arguments", () => {
|
||||
vi.spyOn(process, "platform", "get").mockReturnValue("win32");
|
||||
const managerWithInternals = packageManager as unknown as {
|
||||
shouldUseWindowsShell(command: string): boolean;
|
||||
};
|
||||
|
||||
expect(managerWithInternals.shouldUseWindowsShell("git")).toBe(false);
|
||||
expect(managerWithInternals.shouldUseWindowsShell("npm")).toBe(true);
|
||||
expect(managerWithInternals.shouldUseWindowsShell("pnpm")).toBe(true);
|
||||
expect(managerWithInternals.shouldUseWindowsShell("C:/Program Files/nodejs/npm.cmd")).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("npmCommand", () => {
|
||||
it("should use npmCommand argv for npm installs", async () => {
|
||||
settingsManager = SettingsManager.inMemory({
|
||||
|
||||
Reference in New Issue
Block a user