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] shortcuts target directly appended to the $dir #6243

Open
kengwang opened this issue Dec 16, 2024 · 0 comments
Open

[Bug] shortcuts target directly appended to the $dir #6243

kengwang opened this issue Dec 16, 2024 · 0 comments
Labels

Comments

@kengwang
Copy link

Bug Report

Scenario

I'm trying to add a jar executable shortcut by this manifest

"shortcuts": [
        [
            "java", // consume there is java on the machine
            "App",
            "-jar \"$dir/app.jar\""
        ]
    ]

Current Behavior

target just directly appended to $dir

$target = [System.IO.Path]::Combine($dir, $_.item(0))

Expected Behavior

It should find where the target is just like where the shim creation does.

Scoop/lib/install.ps1

Lines 752 to 759 in 859d1db

if (Test-Path "$dir\$target" -PathType leaf) {
$bin = "$dir\$target"
} elseif (Test-Path $target -PathType leaf) {
$bin = $target
} else {
$bin = (Get-Command $target).Source
}
if (!$bin) { abort "Can't shim '$target': File doesn't exist." }

Possible Solution

It should try to find where the target is and create the link to that.

Please note that the link's working directory just simply reads the $target 's directory, it should be changed to $dir by passing it down.

System details

Windows version: 11

OS architecture: 64bit

PowerShell version: 7.4.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant