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

Doesn't work when the username has space in it #40

Open
fr2edms2ekr opened this issue Sep 22, 2020 · 1 comment
Open

Doesn't work when the username has space in it #40

fr2edms2ekr opened this issue Sep 22, 2020 · 1 comment

Comments

@fr2edms2ekr
Copy link

Just to be clear, it works fine so far using windows powershell, but it fails when switching to git bash (which is what i use almost always), and shows this error:
** Presuming my windows username is Lina Lina**

C:\Users\Lina : The term 'C:\Users\Lina' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • C:\Users\Lina Lina\scoop\apps\sudo\current\sudo.ps1
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\Lina:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
@felipecrs
Copy link

To fix this, the path to sudo must be escaped. Example of a broken shim:

> cat 'C:\Users\Felipe Santos\scoop\shims\sudo'
#!/bin/sh
powershell.exe -noprofile -ex unrestricted "C:\Users\Felipe Santos\scoop\apps\sudo\current\sudo.ps1"  "$@"

Example of a working shim:

> cat 'C:\Users\Felipe Santos\scoop\shims\sudo'
#!/bin/sh
powershell.exe -noprofile -ex unrestricted "C:\Users\Felipe` Santos\scoop\apps\sudo\current\sudo.ps1"  "$@"

Notice the ` before the space.

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

No branches or pull requests

2 participants