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