feat(FN-2689): standardize cross-platform shell selection
- Add engine shell utility to resolve the correct shell per platform - Update routine runner to execute commands through shared shell selection - Update cron runner to use the same cross-platform shell behavior - Apply shared shell handling in dashboard routes for command execution - Add shell utility tests covering platform-specific selection behavior
This commit is contained in:
19
packages/engine/src/__tests__/shell-utils.test.ts
Normal file
19
packages/engine/src/__tests__/shell-utils.test.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it, vi, afterEach } from "vitest";
|
||||
|
||||
describe("shell-utils", () => {
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
it.each([
|
||||
["win32", "cmd.exe"],
|
||||
["linux", "/bin/sh"],
|
||||
])("returns %s shell as %s", async (platform, expectedShell) => {
|
||||
vi.spyOn(process, "platform", "get").mockReturnValue(platform as NodeJS.Platform);
|
||||
|
||||
const { defaultShell } = await import("../shell-utils.js");
|
||||
|
||||
expect(defaultShell).toBe(expectedShell);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user