Skip to content

Commit 4b5970e

Browse files
committed
fix(scoop-version): Fix logic error caused by missing brackets, enhance compatibility of the output
1 parent c9f0728 commit 4b5970e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bin/scoop.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ switch ($subCommand) {
2020
}
2121
({ $subCommand -in @('-v', '--version') }) {
2222
Write-Host 'Current Scoop version:'
23-
if (Test-GitAvailable -and (Test-Path "$PSScriptRoot\..\.git") -and (get_config SCOOP_BRANCH 'master') -ne 'master') {
24-
Invoke-Git -Path "$PSScriptRoot\.." -ArgumentList @('log', 'HEAD', '-1', '--oneline')
23+
if ((Test-GitAvailable) -and (Test-Path "$PSScriptRoot\..\.git") -and ((get_config SCOOP_BRANCH 'master') -ne 'master')) {
24+
Invoke-Git -Path "$PSScriptRoot\.." -ArgumentList @('--no-pager', 'log', 'HEAD', '-1', '--oneline', '--decorate')
2525
} else {
2626
$version = Select-String -Pattern '^## \[(v[\d.]+)\].*?([\d-]+)$' -Path "$PSScriptRoot\..\CHANGELOG.md"
2727
Write-Host $version.Matches.Groups[1].Value -ForegroundColor Cyan -NoNewline
@@ -31,9 +31,9 @@ switch ($subCommand) {
3131

3232
Get-LocalBucket | ForEach-Object {
3333
$bucketLoc = Find-BucketDirectory $_ -Root
34-
if (Test-GitAvailable -and (Test-Path "$bucketLoc\.git")) {
34+
if ((Test-GitAvailable) -and (Test-Path "$bucketLoc\.git")) {
3535
Write-Host "'$_' bucket:"
36-
Invoke-Git -Path $bucketLoc -ArgumentList @('log', 'HEAD', '-1', '--oneline')
36+
Invoke-Git -Path $bucketLoc -ArgumentList @('--no-pager', 'log', 'HEAD', '-1', '--oneline', '--decorate')
3737
Write-Host ''
3838
}
3939
}

0 commit comments

Comments
 (0)