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] Can't add a shim to an exe with spaces in it's filepath #5313

Closed
Myrdden opened this issue Dec 29, 2022 · 2 comments · Fixed by #5424
Closed

[Bug] Can't add a shim to an exe with spaces in it's filepath #5313

Myrdden opened this issue Dec 29, 2022 · 2 comments · Fixed by #5424
Assignees
Labels

Comments

@Myrdden
Copy link

Myrdden commented Dec 29, 2022

So I'm trying to add a shim to open firefox from the command line, seems like the easiest way as I don't want to clutter up PATH, but because Windows land is very liberal with filepaths with spaces, this does not seem to be possible.

Here's the command I'm trying:

scoop add shim firefox "C:\Program Files\Mozilla Firefox\firefox.exe"

The error I receive is:

ERROR: Command path does not exist: C:\Program

I have tried this with every configuration of the path I can think of. Forward slashes, escaping backslashes, single and double quotes, no quotes with escaped spaces, quotes with escaped spaces, including escaped quotes within the quotes, using MSYS instead of powershell with all of the above and it's /c/ paths, every attempt results in the same error. Additionally, for my own sanity, I tried reversing the arguments, in case I was failing to understand how the command worked, and that simply gave an error that Files\Mozilla did not exist. Seems the command is not liking a filepath with spaces.

@Myrdden Myrdden added the bug label Dec 29, 2022
@Valinor Valinor self-assigned this Jan 5, 2023
@Valinor
Copy link
Contributor

Valinor commented Jan 5, 2023

Hello here,
A small question about the current develop and master branch :

Currently, on dev branch (and master), test for "is_in_dir" fails.
Where I read the code, it's seem legit, because the test seem not correct.

    is_in_dir 'C:\test' 'C:\foo' | Should -BeFalse 
    is_in_dir 'C:\test' 'C:\test\foo\baz.zip' | Should -BeTrue => \foo\baz.zip in c:\test

    is_in_dir 'test' "$PSScriptRoot"| Should -BeTrue => $PSScriptRoot is not in test, so BeFalse

The correct way to test should be

    is_in_dir "$PSScriptRoot" 'test'| Should -BeTrue => test is in $PSScriptRoot, so BeTrue

Should I open a new bug report for this test correction?
Can I make a pull request even with this failing test (which is not linked with the current correction?)

Thanks

@rashil2000
Copy link
Member

rashil2000 commented Jan 6, 2023

@Valinor please make a separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment