From 3a3f41c556c044150d86f259c1e3583687b41929 Mon Sep 17 00:00:00 2001 From: Dustin <131928587+dooptydoo90x@users.noreply.github.com> Date: Sun, 8 Oct 2023 08:34:36 -0500 Subject: [PATCH] fix(shim): Fix shim adding bug related to Resolve-Path(#5493) * fixed shim add bug related to #5492 * Updated CHANGLOG.md per contributor guidelines --- CHANGELOG.md | 1 + lib/core.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc390b4cb9..80932a9ff9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,6 +79,7 @@ - **shim:** Exit if shim creating failed 'cause no git ([#5225](https://github.com/ScoopInstaller/Scoop/issues/5225)) - **scoop-import:** Add correct architecture argument ([#5210](https://github.com/ScoopInstaller/Scoop/issues/5210)) - **scoop-config:** Output `[DateTime]` as `[String]` ([#5232](https://github.com/ScoopInstaller/Scoop/issues/5232)) +- **shim:** fixed shim add bug related to Resolve-Path ([#5492](https://github.com/ScoopInstaller/Scoop/issues/5492)) ### Code Refactoring diff --git a/lib/core.ps1 b/lib/core.ps1 index 06c4f1591c..125e679205 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -883,10 +883,10 @@ function shim($path, $global, $name, $arg) { $shim = "$abs_shimdir\$($name.tolower())" # convert to relative path + $resolved_path = Convert-Path $path Push-Location $abs_shimdir - $relative_path = Resolve-Path -Relative $path + $relative_path = Resolve-Path -Relative $resolved_path Pop-Location - $resolved_path = Convert-Path $path if ($path -match '\.(exe|com)$') { # for programs with no awareness of any shell