From 14b38b4092ce9bc66b31fd3de30b5c109be135ef Mon Sep 17 00:00:00 2001 From: "L. Yeung" Date: Tue, 10 Oct 2023 19:20:53 +0800 Subject: [PATCH] fix(scoop-shim): Check literal path in `Get-ShimPath` (#5680) Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com> --- CHANGELOG.md | 1 + libexec/scoop-shim.ps1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e96f74863..5ab4fe6484 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:** Check literal path in `Get-ShimPath` ([#5680](https://github.com/ScoopInstaller/Scoop/issues/5680)) - **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 6cbd53dbd3..cf775b1d6b 100644 --- a/libexec/scoop-shim.ps1 +++ b/libexec/scoop-shim.ps1 @@ -82,7 +82,7 @@ function Get-ShimInfo($ShimPath) { function Get-ShimPath($ShimName, $Global) { '.shim', '.ps1' | ForEach-Object { $shimPath = Join-Path (shimdir $Global) "$ShimName$_" - if (Test-Path $shimPath) { + if (Test-Path -LiteralPath $shimPath) { return $shimPath } }