Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] scoop add shim giving error related to Resolve-Path #5492

Closed
dooptydoo90x opened this issue Apr 30, 2023 · 0 comments · Fixed by #5424
Closed

[Bug] scoop add shim giving error related to Resolve-Path #5492

dooptydoo90x opened this issue Apr 30, 2023 · 0 comments · Fixed by #5424
Labels

Comments

@dooptydoo90x
Copy link
Contributor

dooptydoo90x commented Apr 30, 2023

Bug Report

Current Behavior

Using scoop add shim to add an executable not installed via scoop to the shim folder gives an error message:

C:\Users\***\source\repos\ols> scoop shim add ols .\ols.exe
Adding local shim ols...
Resolve-Path: C:\Users\dusty\scoop\apps\scoop\current\lib\core.ps1:711
Line |
 711 |      $relative_path = Resolve-Path -Relative $path
     |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'C:\Users\dusty\scoop\shims\ols.exe' because it does not exist.

It appears to try to resolve a path of the file I'm creating a shim for after popd'ing into the shim folder, and it's not happy about it, but it shouldn't need to because no one expects a file to be there yet...

Expected Behavior

No such error to occur.

Additional context/output

This doesn't seem to break creating shims generally, because this $relative_path variable seems to only be used if the file you are shimming is on a separate drive from your scoop installation, but it's still a bug.

Possible Solution

I think this may be a simple logic error, but I'm still picking through the code.

System details

Windows 11 64bit
Powershell 7.3.4

Scoop Configuration

{
  "global_path": "D:\\Programs\\Scoop\\Installs\\",
  "cache_path": "D:\\Programs\\Scoop\\Cache\\",
  "last_update": "2023-04-30T12:40:39.1590129-05:00",
  "scoop_repo": "https://github.com/ScoopInstaller/Scoop",
  "scoop_branch": "master"
}
dooptydoo90x added a commit to dooptydoo90x/Scoop that referenced this issue Apr 30, 2023
@dooptydoo90x dooptydoo90x changed the title scoop add shim giving error related to Resolve-Path [Bug] scoop add shim giving error related to Resolve-Path May 10, 2023
rashil2000 pushed a commit that referenced this issue Oct 8, 2023
* fixed shim add bug related to #5492

* Updated CHANGLOG.md per contributor guidelines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant