Compare commits

...
Author SHA1 Message Date
Aiden ClineandGitHub 699563e31f Merge branch 'dev' into snapshot-node-shim-stuff
publish / version (push) Has been cancelled
publish / build-cli (push) Has been cancelled
publish / sign-cli-windows (push) Has been cancelled
publish / build-tauri (map[host:blacksmith-4vcpu-ubuntu-2404 target:x86_64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-tauri (map[host:blacksmith-4vcpu-windows-2025 target:x86_64-pc-windows-msvc]) (push) Has been cancelled
publish / build-tauri (map[host:blacksmith-8vcpu-ubuntu-2404-arm target:aarch64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-tauri (map[host:macos-latest target:aarch64-apple-darwin]) (push) Has been cancelled
publish / build-tauri (map[host:macos-latest target:x86_64-apple-darwin]) (push) Has been cancelled
publish / build-tauri (map[host:windows-2025 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:aarch64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-ubuntu-2404 platform_flag:--linux target:x86_64-unknown-linux-gnu]) (push) Has been cancelled
publish / build-electron (map[host:blacksmith-4vcpu-windows-2025 platform_flag:--win target:x86_64-pc-windows-msvc]) (push) Has been cancelled
publish / build-electron (map[host:macos-latest platform_flag:--mac --arm64 target:aarch64-apple-darwin]) (push) Has been cancelled
publish / build-electron (map[host:macos-latest platform_flag:--mac --x64 target:x86_64-apple-darwin]) (push) Has been cancelled
publish / build-electron (map[host:windows-2025 platform_flag:--win --arm64 target:aarch64-pc-windows-msvc]) (push) Has been cancelled
publish / publish (push) Has been cancelled
2026-04-12 19:58:14 -05:00
Aiden ClineandGitHub 4721b31d35 Merge branch 'dev' into snapshot-node-shim-stuff 2026-04-11 17:14:41 -05:00
Aiden ClineandGitHub 8bce02e567 Merge branch 'dev' into snapshot-node-shim-stuff 2026-04-10 19:55:48 -05:00
Aiden Cline c3dc5a3466 wip: node shim signals 2026-04-10 16:32:16 -05:00
+20 -7
View File
@@ -6,20 +6,33 @@ const path = require("path")
const os = require("os")
function run(target) {
const result = childProcess.spawnSync(target, process.argv.slice(2), {
const child = childProcess.spawn(target, process.argv.slice(2), {
stdio: "inherit",
})
if (result.error) {
console.error(result.error.message)
child.on("error", (err) => {
console.error(err.message)
process.exit(1)
})
const forward = (sig) => {
if (!child.killed) {
try { child.kill(sig) } catch {}
}
}
const code = typeof result.status === "number" ? result.status : 0
process.exit(code)
;["SIGINT", "SIGTERM", "SIGHUP"].forEach((sig) => {
process.on(sig, () => forward(sig))
})
child.on("exit", (code, signal) => {
if (signal) {
process.kill(process.pid, signal)
return
}
process.exit(typeof code === "number" ? code : 1)
})
}
const envPath = process.env.OPENCODE_BIN_PATH
if (envPath) {
run(envPath)
return run(envPath)
}
const scriptPath = fs.realpathSync(__filename)
@@ -28,7 +41,7 @@ const scriptDir = path.dirname(scriptPath)
//
const cached = path.join(scriptDir, ".opencode")
if (fs.existsSync(cached)) {
run(cached)
return run(cached)
}
const platformMap = {