mirror of
https://github.com/browseros-ai/BrowserOS.git
synced 2026-05-19 03:26:28 +00:00
* feat: build prod server resource artifacts with cloudflare r2 * fix: address PR review comments for prod_server_resources_cloudflare * feat: fix prod server build setup and CLI ergonomics * fix: prevent build env secret inlining and template fallback * fix: read from fileenv * feat: add ripgrep * feat: upload prod artifacts to latest and version prefixes
21 lines
503 B
TypeScript
21 lines
503 B
TypeScript
import { spawn } from 'node:child_process'
|
|
|
|
export async function runCommand(
|
|
command: string,
|
|
args: string[],
|
|
env: NodeJS.ProcessEnv,
|
|
cwd?: string,
|
|
): Promise<void> {
|
|
await new Promise<void>((resolve, reject) => {
|
|
const child = spawn(command, args, { cwd, env, stdio: 'inherit' })
|
|
child.on('close', (code) => {
|
|
if (code === 0) {
|
|
resolve()
|
|
return
|
|
}
|
|
reject(new Error(`Command failed (${command}): ${code}`))
|
|
})
|
|
child.on('error', reject)
|
|
})
|
|
}
|