From 5ab580911678eea28986e7b33cef3e9d0613bb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20R=C3=B8nnestad=20Birkeland?= <6450056+o-l-a-v@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:34:50 +0100 Subject: [PATCH 1/2] Don't throw if command not found --- libexec/scoop-shim.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/scoop-shim.ps1 b/libexec/scoop-shim.ps1 index 877b65b2e9..b6be41e5d7 100644 --- a/libexec/scoop-shim.ps1 +++ b/libexec/scoop-shim.ps1 @@ -76,7 +76,7 @@ function Get-ShimInfo($ShimPath) { $info.Alternatives = (@($info.Source) + ($altShims | ForEach-Object { $_.Extension.Remove(0, 1) } | Select-Object -Unique)) -join ' ' } $info.IsGlobal = $ShimPath.StartsWith("$globalShimDir") - $info.IsHidden = !((Get-Command -Name $info.Name).Path -eq $info.Path) + $info.IsHidden = -not ((Get-Command -Name $info.Name -ErrorAction 'Ignore').Path -eq $info.Path) [PSCustomObject]$info } From 265c0983db5b92ff7829d6f718b0d0cd853d3425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20R=C3=B8nnestad=20Birkeland?= <6450056+o-l-a-v@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:36:00 +0100 Subject: [PATCH 2/2] Add change to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9a56e46ad..91bf8cb511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - **commands**: Handling broken aliases ([#6141](https://github.com/ScoopInstaller/Scoop/issues/6141)) - **shim:** Do not suppress `stderr`, properly check `wslpath`/`cygpath` command first ([#6114](https://github.com/ScoopInstaller/Scoop/issues/6114)) - **scoop-bucket:** Add missing import for `no_junction` envs ([#6181](https://github.com/ScoopInstaller/Scoop/issues/6181)) +- **shim:** Don't throw if command was not found ([#6206](https://github.com/ScoopInstaller/Scoop/issues/6206)) ### Code Refactoring