feat: validate installed CLI version before pin-version sync - #24
Merged
Conversation
Add a pre-flight check for `pin-version: true` so run.sh fails fast with a clear error when the installed @basemachina/cli is older than 1.5.0, instead of letting `bm sync` fail later with an unknown-flag error. Prerelease builds (e.g. internal dev builds) are exempted from the check, and an undetectable version only warns and proceeds, since `bm sync` itself will fail if the CLI is truly missing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QJHtSgSBsmL1rdGEgep6rp
|
mock sync output |
|
mock sync output |
|
mock sync output |
|
mock sync output |
m-shaka
marked this pull request as ready for review
August 20, 2026 09:33
m-shaka
enabled auto-merge
August 20, 2026 09:33
yebis0942
approved these changes
Aug 20, 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.
Summary
pin-version: truepasses--pin-versiontobm sync, but that flag only exists in@basemachina/cli1.5.0+. Older CLIs previously failed with a confusing unknown-flag error from the CLI itself.scripts/run.shthat reads the installed CLI version and fails fast with a clear::error::when it is below 1.5.0. The CLI has no--versioncommand, so the version is read from@basemachina/cli/package.jsonresolved from the caller'snode_modules.::notice::, since their numeric parts do not reflect release ordering.node, unresolvable package), only a::warning::is emitted and sync proceeds —bm syncitself fails if the CLI is truly missing, so there is no need to fail twice.Test plan
bats tests/(37/37 passing, including 6 new cases for the version gate)shellcheck -x scripts/*.sh tests/fixtures/bm-mock🤖 Generated with Claude Code
https://claude.ai/code/session_01QJHtSgSBsmL1rdGEgep6rp