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:
@@ -3976,11 +3976,13 @@ async function executeSingleCommand(
|
||||
const { promisify } = await import("node:util");
|
||||
const execAsyncFn = promisify(exec);
|
||||
|
||||
const isWindows = process.platform === "win32";
|
||||
|
||||
try {
|
||||
const { stdout, stderr } = await execAsyncFn(command, {
|
||||
timeout: timeoutMs ?? DEFAULT_AUTOMATION_TIMEOUT_MS,
|
||||
maxBuffer: AUTOMATION_MAX_BUFFER,
|
||||
shell: "/bin/sh",
|
||||
shell: isWindows ? "cmd.exe" : "/bin/sh",
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user