Skip to content

fix(cli): correct update-check version comparison + support --version#1264

Merged
iammukeshm merged 1 commit into
mainfrom
fix/cli-version-comparison-and-version-flag
May 27, 2026
Merged

fix(cli): correct update-check version comparison + support --version#1264
iammukeshm merged 1 commit into
mainfrom
fix/cli-version-comparison-and-version-flag

Conversation

@iammukeshm
Copy link
Copy Markdown
Member

Found while smoke-testing the CLI ahead of release.

Bug 1 — phantom "update available". fsh info and the post-scaffold update check in fsh new compared versions with string inequality. Since the running version carries a +gitsha suffix (and "latest" from NuGet can be a prerelease), they always nagged "update available" — even when the local build was newer than what's published (10.0.0 vs 10.0.0-rc.2; template 10.0.0 vs 2.0.4-rc). Added VersionComparer.IsNewer (semver-aware: ignores build metadata, ranks stable above prerelease of the same core version) and used it in both spots.

Bug 2 — fsh --version errored. It printed "Did you forget the command?". Wired config.SetApplicationVersion(...) so fsh --version10.0.0.

Verified: fsh --version10.0.0; fsh info now shows "up to date" for CLI + template.

🤖 Generated with Claude Code

`fsh info` and `fsh new`'s update check compared versions with string
inequality, and the current version carries a `+gitsha` build-metadata suffix,
so they always reported "update available" -- even when the local build was
NEWER than the latest published prerelease (10.0.0 vs 10.0.0-rc.2, and template
10.0.0 vs 2.0.4-rc). Added a small semver-aware VersionComparer.IsNewer (drops
build metadata, ranks a stable release above a prerelease of the same core) and
used it in both places, so the hint only shows for a genuine upgrade.

Also wired config.SetApplicationVersion so `fsh --version` prints the version
instead of erroring "Did you forget the command?".

Found while smoke-testing the CLI for release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@iammukeshm iammukeshm merged commit 5421ef5 into main May 27, 2026
16 checks passed
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