-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Bug Report
Current Behavior
In a terminal, I'm looking for the Scoop version and get:
> scoop --version
Current Scoop version:
b588a06e (HEAD -> master, tag: v0.5.3, origin/master, origin/HEAD) Bump to version 0.5.3 (resync) (#6436)
'main' bucket:
46c50c6b0 (HEAD -> master, origin/master, origin/HEAD) aqua: fix arm64 version (#7071)
Expected Behavior
That looks new to me, as I used to have an output like that:
> scoop --version
Current Scoop version:
v0.5.3 - Released at 2025-08-11
'main' bucket:
46c50c6b0 (HEAD -> master, origin/master, origin/HEAD) aqua: fix arm64 version (#7071)
Additional context/output
I am expecting a clean version output as that is what I am relying on to detect the presence of a fresh Scoop CLI in my Meta Package Manager project.
For reference, my current implementation is based on regular expressions.
Possible Solution
I bypassed that issue by looking harder at a version string in the output produced by Git but that is too fragile.
My guess is the format of the CHANGELOG.md
had a recent subtle change that made the regular expression not matching anymore:
Lines 22 to 29 in b588a06
Write-Host 'Current Scoop version:' | |
if (Test-GitAvailable -and (Test-Path "$PSScriptRoot\..\.git") -and (get_config SCOOP_BRANCH 'master') -ne 'master') { | |
Invoke-Git -Path "$PSScriptRoot\.." -ArgumentList @('log', 'HEAD', '-1', '--oneline') | |
} else { | |
$version = Select-String -Pattern '^## \[(v[\d.]+)\].*?([\d-]+)$' -Path "$PSScriptRoot\..\CHANGELOG.md" | |
Write-Host $version.Matches.Groups[1].Value -ForegroundColor Cyan -NoNewline | |
Write-Host " - Released at $($version.Matches.Groups[2].Value)" | |
} |
Or maybe the logic needs to be tweaked a bit so that the official released version is returned if the commit is a tag.
System details
Windows version: 11 Pro
OS architecture: arm64
PowerShell version: 5.1.22000.2538
Additional software: Git v2.50.1.windows.1
Scoop Configuration
Default.