From 5b5daa5ee96edcfe911d52e5ef9584adffa67f64 Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Sun, 7 Aug 2022 02:57:12 +0800 Subject: [PATCH] fix(installed): Use 'System.Nullable' for param 'global' (#5088) --- CHANGELOG.md | 1 + lib/core.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f91adeb370..e1e0bb8791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ ### Bug Fixes - **core:** Avoid deadlock in `Invoke-ExternalCommand` ([#5064](https://github.com/ScoopInstaller/Scoop/issues/5064)) +- **core:** Use 'System.Nullable' for param 'global' ([#5088](https://github.com/ScoopInstaller/Scoop/issues/5088)) - **install:** Move from cache when `--no-cache` is specified ([#5039](https://github.com/ScoopInstaller/Scoop/issues/5039)) - **scoop-status:** Correct formatting of `Info` output ([#5047](https://github.com/ScoopInstaller/Scoop/issues/5047)) diff --git a/lib/core.ps1 b/lib/core.ps1 index 08c3f3a5ac..94f555587d 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -225,8 +225,8 @@ function cache_path($app, $version, $url) { "$cachedir\$app#$version#$($url -rep # apps function sanitary_path($path) { return [regex]::replace($path, "[/\\?:*<>|]", "") } -function installed($app, $global) { - if (-not $PSBoundParameters.ContainsKey('global')) { +function installed($app, [Nullable[bool]]$global) { + if ($null -eq $global) { return (installed $app $false) -or (installed $app $true) } # Dependencies of the format "bucket/dependency" install in a directory of form