You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the installation invoke sudo if the user is not root and $out_prefix is not in $HOME. This heuristic has a lot of false positives, all of the failures I looked at http://matrix.cpantesters.org/?dist=Alien-libextism%20v0.1.1 appear to be the cli install script attempting sudo in a scenario where it shouldn't.
If we insist on installing with sudo, rather that attempting to detect when it's needed, we should try without, and on permission error retry with sudo.
However, instead I think we should make two changes:
Don't use sudo at all in the install script. I will use sudo or run it as root myself if I am going to install somewhere that I don't have write access to.
Install the cli to a $HOME directory by default. After installing the file on disk, to get it in $PATH, I prefer when it spits out instructions rather than appends to a dot file, as I know best how to handle my own dot files (I append to .profile on my systems for efficiency reasons, though it requires logging out and back in for it to take effect). This removes the need for root/sudo for the default install case. If we wanted to we could add a flag to get a system install that just sets the prefix to /usr/local/bin.
The text was updated successfully, but these errors were encountered:
Yeah, I think either of those solutions sound good - it sounds like the first option is a little more automatic, but both are common patterns people will be used to. We should just make sure to test all the edge cases before updating all the docs - I'm happy to help with that when you're ready.
Currently the installation invoke
sudo
if the user is notroot
and$out_prefix
is not in$HOME
. This heuristic has a lot of false positives, all of the failures I looked at http://matrix.cpantesters.org/?dist=Alien-libextism%20v0.1.1 appear to be the cli install script attempting sudo in a scenario where it shouldn't.If we insist on installing with
sudo
, rather that attempting to detect when it's needed, we should try without, and on permission error retry with sudo.However, instead I think we should make two changes:
Don't use sudo at all in the install script. I will use sudo or run it as root myself if I am going to install somewhere that I don't have write access to.
Install the cli to a
$HOME
directory by default. After installing the file on disk, to get it in$PATH
, I prefer when it spits out instructions rather than appends to a dot file, as I know best how to handle my own dot files (I append to.profile
on my systems for efficiency reasons, though it requires logging out and back in for it to take effect). This removes the need for root/sudo for the default install case. If we wanted to we could add a flag to get a system install that just sets the prefix to/usr/local/bin
.The text was updated successfully, but these errors were encountered: