Revert "cache platform binary in postinstall for faster startup" (#14457)

This commit is contained in:
Aiden Cline
2026-02-20 09:28:49 -06:00
committed by GitHub
parent c79f1a72d8
commit 1ffed2fa6c
2 changed files with 4 additions and 13 deletions

View File

@@ -25,11 +25,6 @@ if (envPath) {
const scriptPath = fs.realpathSync(__filename) const scriptPath = fs.realpathSync(__filename)
const scriptDir = path.dirname(scriptPath) const scriptDir = path.dirname(scriptPath)
const cached = path.join(scriptDir, ".opencode")
if (fs.existsSync(cached)) {
run(cached)
}
const platformMap = { const platformMap = {
darwin: "darwin", darwin: "darwin",
linux: "linux", linux: "linux",

View File

@@ -106,15 +106,11 @@ async function main() {
return 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 { binaryPath } = findBinary()
const target = path.join(__dirname, "..", "bin", ".opencode") console.log(`Platform binary verified at: ${binaryPath}`)
if (fs.existsSync(target)) fs.unlinkSync(target) console.log("Wrapper script will handle binary execution")
try {
fs.linkSync(binaryPath, target)
} catch {
fs.copyFileSync(binaryPath, target)
}
fs.chmodSync(target, 0o755)
} catch (error) { } catch (error) {
console.error("Failed to setup opencode binary:", error.message) console.error("Failed to setup opencode binary:", error.message)
process.exit(1) process.exit(1)