cache platform binary in postinstall for faster startup (#14467)

This commit is contained in:
Aiden Cline
2026-02-20 12:19:17 -06:00
committed by GitHub
parent 46361cf35c
commit 1d9f05e4f5
2 changed files with 14 additions and 2 deletions

View File

@@ -25,6 +25,12 @@ 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",