Skip to content

Commit

Permalink
refactor(scoop-status): restore Windows PowerShell 5.1 compatibility
Browse files Browse the repository at this point in the history
Powershell 5.1 does not support null-coalescence operators.
  • Loading branch information
BinToss committed Jan 28, 2025
1 parent 9283b41 commit 82d4784
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libexec/scoop-status.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ $true, $false | ForEach-Object { # local and global apps
$dir = appsdir $global
if (!(Test-Path $dir)) { return }

[string[]] $appNames = (Get-ChildItem $dir -Directory -Name -Exclude 'scoop' | Where-Object Length -GT 0) ?? @()
$appNames = @(Get-ChildItem $dir -Directory -Name -Exclude 'scoop' | Where-Object Length -GT 0)

if ($appNames.Length -eq 0) { return }

foreach ($app in $appNames) {
Expand Down

0 comments on commit 82d4784

Please sign in to comment.