Skip to content

Commit 7dc56c5

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 anomalyco#197 Fix verified locally by running local npm registry: ``` cat > ./verdaccio.local.yaml <<'YAML' max_body_size: 200mb storage: ./storage uplinks: npmjs: url: https://registry.npmjs.org/ packages: "@*/*": access: $all publish: $all proxy: npmjs "**": access: $all publish: $all proxy: npmjs YAML npx verdaccio@latest --listen 4873 --config ./verdaccio.local.yaml ``` And publishing opencode to that: ``` OPENCODE_VERSION="1.0.0-local" OPENCODE_DRY="false" bun run script/publish.ts ``` The `packages/opencode/script/publish.ts` was updated to publish to local registry by appending `--registry http://localhost:4873` to the `bun publish` 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 opencode-ai@1.0.0-local ```
1 parent a45fa7a commit 7dc56c5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/opencode/script/postinstall.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async function main() {
119119
}
120120

121121
// Create symlink to the actual binary
122-
fs.symlinkSync(binaryPath, binScript)
122+
fs.symlinkSync(path.relative(path.dirname(binScript), binaryPath), binScript)
123123
console.log(`opencode binary symlinked: ${binScript} -> ${binaryPath}`)
124124
} catch (error) {
125125
console.error("Failed to create opencode binary symlink:", error.message)

0 commit comments

Comments
 (0)