Skip to content

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

@dooptydoo90x

Description

@dooptydoo90x

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"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions