Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/opencode/bin/mimo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ const path = require("path")
const os = require("os")

function run(target) {
const result = childProcess.spawnSync(target, process.argv.slice(2), {
// On Android/Termux, glibc-linked binaries need grun (glibc-runner)
const isAndroid = os.platform() === "android"
const args = isAndroid ? ["grun", target, ...process.argv.slice(2)] : [target, ...process.argv.slice(2)]
const result = childProcess.spawnSync(args[0], args.slice(1), {
stdio: "inherit",
})
if (result.error) {
Expand Down Expand Up @@ -35,6 +38,7 @@ const platformMap = {
darwin: "darwin",
linux: "linux",
win32: "windows",
android: "linux", // Termux/Android uses linux binary via grun
}
const archMap = {
x64: "x64",
Expand Down
4 changes: 4 additions & 0 deletions packages/opencode/script/postinstall.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ function detectPlatformAndArch() {
case "linux":
platform = "linux"
break
case "android":
// Termux/Android — use linux-arm64 binary via grun (glibc runner)
platform = "linux"
break
case "win32":
platform = "windows"
break
Expand Down