From 2847e0a37c981ffc709af0edab4ceceb44a7656b Mon Sep 17 00:00:00 2001 From: "L. Yeung" Date: Tue, 10 Oct 2023 19:17:46 +0800 Subject: [PATCH] fix(scoop-shim): Avoid unexpected output of `list` subcommand (#5681) * fix(shim): Avoid unexpected output of `list` subcommand * Update libexec/scoop-shim.ps1 Co-authored-by: Hsiao-nan Cheung --------- Co-authored-by: Hsiao-nan Cheung --- CHANGELOG.md | 1 + libexec/scoop-shim.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80932a9ff9..9e96f74863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ - **scoop-checkup:** Change the message level of helpers from ERROR to WARN ([#5549](https://github.com/ScoopInstaller/Scoop/issues/5614)) - **scoop-(un)hold:** Correct output the messages when manifest not found, (already|not) held ([#5519](https://github.com/ScoopInstaller/Scoop/issues/5519)) - **scoop-update:** Change error message to a better instruction ([#5677](https://github.com/ScoopInstaller/Scoop/issues/5677)) +- **shim:** Avoid unexpected output of `list` subcommand ([#5681](https://github.com/ScoopInstaller/Scoop/issues/5681)) ### Performance Improvements diff --git a/libexec/scoop-shim.ps1 b/libexec/scoop-shim.ps1 index 41263afe6a..6cbd53dbd3 100644 --- a/libexec/scoop-shim.ps1 +++ b/libexec/scoop-shim.ps1 @@ -12,7 +12,7 @@ # # To list all shims or matching shims, use the 'list' subcommand: # -# scoop shim list [/...] +# scoop shim list [...] # # To show a shim's information, use the 'info' subcommand: # @@ -144,7 +144,7 @@ switch ($SubCommand) { $other | ForEach-Object { try { $pattern = $_ - [Regex]::New($pattern) + [void][Regex]::New($pattern) } catch { Write-Host "ERROR: Invalid pattern: " -ForegroundColor Red -NoNewline Write-Host $pattern -ForegroundColor Magenta