MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / scriptFile

Function scriptFile

projects/runtime-node/src/localProcess.ts:137–143  ·  view source on GitHub ↗
(script: string)

Source from the content-addressed store, hash-verified

135}
136
137async function scriptFile(script: string): Promise<string> {
138 const dir = await fs.mkdtemp(path.join(os.tmpdir(), "runtime-node-script-"))
139 const filePath = path.join(dir, process.platform === "win32" ? "script.ps1" : "script.sh")
140 await fs.writeFile(filePath, script, "utf8")
141 await fs.chmod(filePath, 0o700).catch(() => undefined)
142 return filePath
143}
144
145function scriptCommand(filePath: string): { command: string; args: string[] } {
146 if (process.platform === "win32") return { command: "powershell.exe", args: ["-ExecutionPolicy", "Bypass", "-File", filePath] }

Callers 1

startScriptFunction · 0.85

Calls 1

writeFileMethod · 0.80

Tested by

no test coverage detected