wf-install icon indicating copy to clipboard operation
wf-install copied to clipboard

install.sh: Support tilde in prefix

Open soreau opened this issue 5 years ago • 4 comments

Without this, the script tries to use sudo for paths owned by user.

soreau avatar Dec 11 '20 07:12 soreau

Using eval like this is is dangerous, it will not only expand the ~ but also $(…), backquotes and probably some other characters.

This post seems to suggest a safer way (search-and-replace a leading ~ with the value of $HOME):

PREFIX="${PREFIX/#\~/$HOME}"

SuzanneSoy avatar Mar 08 '21 18:03 SuzanneSoy

Using eval like this is is dangerous, it will not only expand the ~ but also $(…), backquotes and probably some other characters.

This post seems to suggest a safer way (search-and-replace a leading ~ with the value of $HOME):

PREFIX="${PREFIX/#\~/$HOME}"

Ah thanks, I'll have to update the PR. 👍

soreau avatar Mar 08 '21 18:03 soreau

No need, I already made #26 which does just this :)

SuzanneSoy avatar Mar 09 '21 23:03 SuzanneSoy

I'm busy right now but I'm making a note update this to fix the conflicts this weekend.

SuzanneSoy avatar Jun 03 '21 00:06 SuzanneSoy