MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / runScript

Function runScript

__tests__/scripts/docker-entrypoint-preflight.test.ts:71–88  ·  view source on GitHub ↗
(body: string, env: NodeJS.ProcessEnv = {})

Source from the content-addressed store, hash-verified

69// The preflight blocks run before `body`, so the persistence dirs default to a
70// writable scratch path that lets those blocks pass.
71function runScript(body: string, env: NodeJS.ProcessEnv = {}) {
72 const writable = path.join(scratch, "ok");
73 return spawnSync("bash", ["-c", `${HARNESS}\n${body}\n`], {
74 encoding: "utf-8",
75 env: {
76 ...process.env,
77 HOME: path.join(scratch, "home"),
78 XDG_CONFIG_HOME: path.join(scratch, "config"),
79 OPENHANDS_DIR: writable,
80 OH_PERSISTENCE_DIR: writable,
81 OH_CONVERSATIONS_PATH: writable,
82 OH_BASH_EVENTS_DIR: writable,
83 LOCAL_STORAGE_PATH: writable,
84 AUTOMATION_WORKSPACE_BASE: writable,
85 ...env,
86 },
87 });
88}
89
90// Drive the reporter directly with the error strings the kernel actually emits.
91function runReport(osError: string) {

Callers 2

runReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected