Repository navigation
fix(plugin): re-link script plugins on update so the real version is detected - #35
Merged
Merged
Conversation
…detected `plugin update` for a script plugin reran the install script but read the version through the existing ~/.clime/plugins/clime-<name> link, which only Install creates. If that link had drifted away from binary_path (for example a plugin's own self-upgrade renamed a new binary over the link, leaving a standalone stale copy), update kept reading the stale copy, reported "Plugin <name> is up to date" and never refreshed the recorded version. - ScriptInstaller.Update now re-points the link at binary_path (or the binary found on PATH) after the script runs, sharing the resolution and linking code with Install. If the binary can't be located, the existing link is kept as before. - `clime init` now records binary_path in the local manifest, so update can re-link plugins whose binary name differs from the plugin name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
git-hulk
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
For a script plugin,
clime plugin update <name>can printPlugin <name> is up to dateeven though the install script has just installed a newer binary. The recorded version never changes, soclime plugin listkeeps showing the old one.ScriptInstaller.Updatereruns the install script, which writes tobinary_path. It then detects the version through~/.clime/plugins/clime-<name>(plugin.Find). OnlyInstallcreates that symlink. Once the link stops pointing atbinary_path,updateinstalls to one file and reads the version from another. One way this happens: a plugin with its own self-upgrade command, started through the clime link, renames its new binary overos.Executable(). That is the link path on macOS, so the link becomes a standalone stale copy. If that copy's version equals the recorded version,updatereports "up to date" from then on.Fix
ScriptInstaller.Updatere-pointsclime-<name>at the installed binary after the script runs. It looks forbinary_pathfirst, then the name onPATH, and shares this resolution and linking code withInstall. If the binary can't be located, the existing link is kept as before.clime initrecordsbinary_pathin the local manifest. It was always written as"", soupdatehad nothing to re-link to when the binary name differs from the plugin name.Repro (before this change)
~/.clime/plugins/clime-toolpoints to an old binary that printsv1.0.0, and the recorded version is1.0.0.v2.0.0tobinary_path.clime plugin update toolprints✓ Plugin tool is up to date, and the record stays at1.0.0.Tests
TestScriptInstallerUpdateRelinksDriftedSymlinkcovers this case. It fails onmasterand passes with this change.go test ./...passes. Locally,internal/skill'sTestCloneAtVersiononly passes withGIT_CONFIG_GLOBAL=/dev/null, becausetag.gpgSign=truein a global git config makes itsgit tagcall ask for a message. That is unrelated to this change.Not in this PR:
clime plugin liststill shows the recorded version rather than running-vlive, so an upgrade done outside clime shows up only after the nextclime plugin update.🤖 Generated with Claude Code