Skip to content

Commit

Permalink
fix(shim): Fix shim adding bug related to Resolve-Path(#5493)
Browse files Browse the repository at this point in the history
* fixed shim add bug related to #5492

* Updated CHANGLOG.md per contributor guidelines
  • Loading branch information
dooptydoo90x authored Oct 8, 2023
1 parent 15f9bbe commit 3a3f41c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a3f41c

Please sign in to comment.