mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 05:20:43 +00:00
10 lines
374 B
TypeScript
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];
|
|
}
|