Skip to content

Add --current flag to version for reading a project's version read-only - #22

Merged
philasmar merged 1 commit into
devfrom
add-version-current-flag
Aug 24, 2026
Merged

Add --current flag to version for reading a project's version read-only#22
philasmar merged 1 commit into
devfrom
add-version-current-flag

Conversation

@philasmar

Copy link
Copy Markdown
Owner

Summary

  • Adds version --current: prints each project's already-set version and exits, without incrementing, committing, or tagging anything.
  • A single project (the common case) prints as a bare value, matching changelog --release-name's existing convention for shell capture (VERSION=$(autover version --current)).

Motivation

A CI pipeline that needs to tag a published artifact (e.g. a container image) with a project's current version has no existing read-only way to get that value without either bumping it or hand-parsing the project file.

Test plan

  • dotnet build AutoVer.slnx - clean
  • dotnet test AutoVer.slnx - 153/153 passing
  • New regression test (VersionCommandTests.Current_PrintsVersionWithoutMutating) verified against the pre-fix code (confirmed it fails) before restoring the fix

@philasmar
philasmar merged commit 6ce2614 into dev Aug 24, 2026
2 checks passed
@philasmar
philasmar deleted the add-version-current-flag branch August 24, 2026 19:56
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