Files
openclaw/src/infra/node-shell.ts
2026-04-11 01:17:51 +01:00

10 lines
374 B
TypeScript

import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
export function buildNodeShellCommand(command: string, platform?: string | null) {
const normalized = normalizeLowercaseStringOrEmpty((platform ?? "").trim());
if (normalized.startsWith("win")) {
return ["cmd.exe", "/d", "/s", "/c", command];
}
return ["/bin/sh", "-lc", command];
}