oh-my-opencode-darwin-arm64 4.8.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/oh-my-opencode.js +25 -0
- package/package.json +1 -1
package/bin/oh-my-opencode.js
CHANGED
|
@@ -87,16 +87,41 @@ if (shouldRunLazyCodexInstaller()) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
const cliPath = join(wrapperPackageRoot, "dist", "cli", "index.js");
|
|
90
|
+
const nodeCliPath = join(wrapperPackageRoot, "dist", "cli-node", "index.js");
|
|
90
91
|
|
|
91
92
|
if (!existsSync(cliPath)) {
|
|
92
93
|
console.error(`oh-my-opencode: packaged CLI not found at ${cliPath}`);
|
|
93
94
|
process.exit(2);
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
function runNodeCli(reason) {
|
|
98
|
+
if (!existsSync(nodeCliPath)) return;
|
|
99
|
+
if (reason) {
|
|
100
|
+
console.error(`oh-my-opencode: ${reason}; falling back to the node CLI at ${nodeCliPath}`);
|
|
101
|
+
}
|
|
102
|
+
const result = spawnSync(process.execPath, [nodeCliPath, ...process.argv.slice(2)], {
|
|
103
|
+
stdio: "inherit",
|
|
104
|
+
env: process.env,
|
|
105
|
+
});
|
|
106
|
+
exitFromResult(result, "failed to execute the node CLI");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (process.env.OMO_RUNTIME === "node") {
|
|
110
|
+
runNodeCli();
|
|
111
|
+
}
|
|
112
|
+
|
|
96
113
|
const bunBinary = process.env.BUN_BINARY || "bun";
|
|
97
114
|
const result = spawnSync(bunBinary, [cliPath, ...process.argv.slice(2)], {
|
|
98
115
|
stdio: "inherit",
|
|
99
116
|
env: process.env,
|
|
100
117
|
});
|
|
101
118
|
|
|
119
|
+
if (result.error) {
|
|
120
|
+
runNodeCli(`bun is not available (${result.error.message})`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (result.signal === "SIGILL") {
|
|
124
|
+
runNodeCli("bun crashed with SIGILL - this CPU lacks the instruction set bun requires (x86-64-v2/SSE4.2 or newer)");
|
|
125
|
+
}
|
|
126
|
+
|
|
102
127
|
exitFromResult(result, "failed to execute Bun");
|