diff options
| author | Aiden Cline <[email protected]> | 2026-02-20 09:28:49 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-20 09:28:49 -0600 |
| commit | 1ffed2fa6ce16392e4f113108c8c76f5440aecc5 (patch) | |
| tree | 31ecb3ff0886ecae74fe03769e8f68ae996dc8d2 /packages | |
| parent | c79f1a72d8f4b1a270c234f967bd9f2bed72a1f0 (diff) | |
| download | opencode-1ffed2fa6ce16392e4f113108c8c76f5440aecc5.tar.gz opencode-1ffed2fa6ce16392e4f113108c8c76f5440aecc5.zip | |
Revert "cache platform binary in postinstall for faster startup" (#14457)
Diffstat (limited to 'packages')
| -rwxr-xr-x | packages/opencode/bin/opencode | 5 | ||||
| -rw-r--r-- | packages/opencode/script/postinstall.mjs | 12 |
2 files changed, 4 insertions, 13 deletions
diff --git a/packages/opencode/bin/opencode b/packages/opencode/bin/opencode index 7d0fabaf3..d73bbce26 100755 --- a/packages/opencode/bin/opencode +++ b/packages/opencode/bin/opencode @@ -25,11 +25,6 @@ if (envPath) { const scriptPath = fs.realpathSync(__filename) const scriptDir = path.dirname(scriptPath) -const cached = path.join(scriptDir, ".opencode") -if (fs.existsSync(cached)) { - run(cached) -} - const platformMap = { darwin: "darwin", linux: "linux", diff --git a/packages/opencode/script/postinstall.mjs b/packages/opencode/script/postinstall.mjs index 67b2e35fc..e8b5e995c 100644 --- a/packages/opencode/script/postinstall.mjs +++ b/packages/opencode/script/postinstall.mjs @@ -106,15 +106,11 @@ async function main() { return } + // On non-Windows platforms, just verify the binary package exists + // Don't replace the wrapper script - it handles binary execution const { binaryPath } = findBinary() - const target = path.join(__dirname, "..", "bin", ".opencode") - if (fs.existsSync(target)) fs.unlinkSync(target) - try { - fs.linkSync(binaryPath, target) - } catch { - fs.copyFileSync(binaryPath, target) - } - fs.chmodSync(target, 0o755) + console.log(`Platform binary verified at: ${binaryPath}`) + console.log("Wrapper script will handle binary execution") } catch (error) { console.error("Failed to setup opencode binary:", error.message) process.exit(1) |
