Skip to content

Sync plugin.json version from git tag on build - #28

Merged
5uck1ess merged 3 commits into
mainfrom
fix/sync-plugin-version
Apr 6, 2026
Merged

Sync plugin.json version from git tag on build#28
5uck1ess merged 3 commits into
mainfrom
fix/sync-plugin-version

Conversation

@5uck1ess

@5uck1ess 5uck1ess commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds sync-version Makefile target that writes the latest semver git tag into plugin.json
  • Makes build and install depend on sync-version so it runs automatically
  • Fixes the "launch twice to see correct version" bug — plugin metadata and binary now always agree

Test plan

  • Run make build after tagging a new version — verify plugin.json updates
  • Run make build when versions already match — verify no-op (no output)
  • Launch Claude Code once and confirm plugin shows correct version

5uck1ess added 3 commits April 5, 2026 23:00
Adds sync-version target to Makefile that writes the latest semver
tag into plugin.json before compiling. Eliminates stale version on
first Claude Code launch — the binary and plugin metadata now always
agree.
- Fix broken fallback: use subshell so 0.0.0 actually fires when no tags
- Warn instead of silent no-op when jq is missing or no tags found
- Skip writing 0.0.0 to avoid downgrading real versions
- Clean up .tmp file on jq/mv failure
- Use order-only prerequisites to prevent parallel-make races
- Fail fast on malformed plugin.json instead of cascading to misleading error
- Add semver format validation to reject non-semver git tags
- Replace Unicode arrow with ASCII -> for CI/terminal portability
@5uck1ess
5uck1ess merged commit 07ff411 into main Apr 6, 2026
3 checks passed
@5uck1ess
5uck1ess deleted the fix/sync-plugin-version branch April 6, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant