-
Notifications
You must be signed in to change notification settings - Fork 23
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
If installing as root use different PATH from ~/.local/bin #48
Comments
I think something simpler like this would be a better idea than #42. I investigated what rustup does, and what I found is:
The problem is setting up swiftly's installation script to do all these is a little bit weird/hard to me. Definitely doable though. We might be able to do something like this:
At some point we might need to ask for sudo if the user is not root or ask for entering a manual path. |
I think always following the XDG base directory specification is still the right approach even for the root user, since installing something as root doesn't necessarily imply that you want that installation available to all users on a system. It is true that root doesn't have
Yeah, this is something @adam-fowler suggested a while back. I've held off on doing it so far since I didn't want to accidentally clobber a user's shell configuration, but I think it's something we'll want to do eventually. I'll investigate it as part of #42 to see how much work is involved there. If it's not too bad, we can do it as part of that and otherwise split it off and address it in the future.
This is an interesting idea, but I think it's best if we stick to a simpler approach that follows the base directory specification. It's a widely known and familiar spec that makes it so handing things like this is relatively straightforward and standardized. Rust notably doesn't follow the spec right now, but I don't think their example is necessarily one we want to follow in this case (rust-lang/cargo#1734 has 200 thumbs up). I also think that changing where the installation goes depending on the value of PATH might be surprising to some users. So all that being said, I'm inclined to say that it's probably best that we don't do this, but that once we do #42, this issue will be less of a concern. |
Now that #42 has been completed, I think we can close this. |
In general root users do not have
~/.local/bin
in their PATH. If the user is installing as root perhaps we should use a different PATH. I think we should also warn the user when installing as root.The text was updated successfully, but these errors were encountered: