fix(scoop-shim): Check literal path in Get-ShimPath (#5680)

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
This commit is contained in:
L. Yeung
2023-10-10 19:20:53 +08:00
committed by GitHub
parent 2847e0a37c
commit 14b38b4092
2 changed files with 2 additions and 1 deletions

View File

@@ -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-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-(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)) - **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)) - **shim:** Avoid unexpected output of `list` subcommand ([#5681](https://github.com/ScoopInstaller/Scoop/issues/5681))
### Performance Improvements ### Performance Improvements

View File

@@ -82,7 +82,7 @@ function Get-ShimInfo($ShimPath) {
function Get-ShimPath($ShimName, $Global) { function Get-ShimPath($ShimName, $Global) {
'.shim', '.ps1' | ForEach-Object { '.shim', '.ps1' | ForEach-Object {
$shimPath = Join-Path (shimdir $Global) "$ShimName$_" $shimPath = Join-Path (shimdir $Global) "$ShimName$_"
if (Test-Path $shimPath) { if (Test-Path -LiteralPath $shimPath) {
return $shimPath return $shimPath
} }
} }