Skip to content

Commit b4cee45

Browse files
committed
fix: installation via volta broken due to symbolic links pointing to tmp file
The PR uses a relative path for symbolic link See https://github.com/sst/opencode/ssues/197 Fix verified locally by running local npm registry: ``` npx verdaccio@latest --listen 4873 ``` And publishing opencode to that: ``` OPENCODE_VERSION="1.0.0-local" OPENCODE_DRY="false" bun run script/publish.ts ``` The `script/publish.ts` was updated to publish to local registry by appending `--registry http://localhost:4873` to the `bun install` commands. Volta was then used to install from the local registry: ``` NPM_CONFIG_REGISTRY=http://localhost:4873 npm_config_registry=http://localhost:4873 volta install [email protected] ```
1 parent 0b45187 commit b4cee45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/opencode/script/postinstall.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function main() {
7979
}
8080

8181
// Create symlink to the actual binary
82-
fs.symlinkSync(binaryPath, binScript)
82+
fs.symlinkSync(path.relative(path.dirname(binScript), binaryPath), binScript)
8383
console.log(`opencode binary symlinked: ${binScript} -> ${binaryPath}`)
8484
} catch (error) {
8585
console.error("Failed to create opencode binary symlink:", error.message)

0 commit comments

Comments
 (0)