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:
Fusion
2026-04-27 08:33:03 -07:00
committed by gsxdsm
parent e877d99262
commit db95f77d7b
5 changed files with 28 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ import type { TaskStore } from "@fusion/core";
import type { AutomationStore } from "@fusion/core";
import type { ScheduledTask, AutomationRunResult, AutomationStep, AutomationStepResult, Column, TaskCreateInput } from "@fusion/core";
import { createLogger } from "./logger.js";
import { defaultShell } from "./shell-utils.js";
const execAsync = promisify(exec);
const log = createLogger("cron-runner");
@@ -266,7 +267,7 @@ export class CronRunner {
const { stdout, stderr } = await execAsync(schedule.command, {
timeout: timeoutMs,
maxBuffer: MAX_BUFFER,
shell: "/bin/sh",
shell: defaultShell,
});
const output = truncateOutput(stdout, stderr);
@@ -421,7 +422,7 @@ export class CronRunner {
const { stdout, stderr } = await execAsync(step.command, {
timeout: timeoutMs,
maxBuffer: MAX_BUFFER,
shell: "/bin/sh",
shell: defaultShell,
});
return {