-
Notifications
You must be signed in to change notification settings - Fork 53
Provide an env.sh
file that can be sourced, automatically update shell profile config file to source it
#53
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
Conversation
@swift-server-bot test install please |
@swift-server-bot test install please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@swift-server-bot test install please |
This has never worked for me on any clean vanilla Ubuntu 20, 22, or 24 installs. I'm not entirely sure why, but the "Terminal" app in Ubuntu simply doesn't load the .profile file by default. So I run the swiftly curl install incantation and have to manually add the env.sh invocation in the user's .bashrc Perhaps relevant: https://superuser.com/questions/183870/difference-between-bashrc-and-bash-profile/183980#183980
|
There might be a reason for this :) |
Closes #42
This PR updates
swiftly-install.sh
to create$SWIFTLY_HOME_DIR/env.sh
, which contains the required environment variable definitions needed to run swiftly. After installation, users can source it to enable using swiftly in their current shell easily.This PR also updates
swiftly-install.sh
to optionally modify the user's login shell configuration profile (on by default) to include a line that sources the aforementionedenv.sh
file. For right now, only one of.profile
,.bash_profile
,.bash_login
, or.zprofile
will be modified, depending on the value of$SHELL
and the existence of said files. In other words, only login configuration files will be modified but not any per-shell rc files like.bashrc
. The reasons for this are twofold: 1) environment variables that are inherited by subshells are supposed to be defined in a login configuration file, not an rc file, since otherwise they would get redefined in each subshell, possibly recursively (as is the case with $PATH), 2) this approach is more conservative and can be extended in the future should.profile
and friends prove to be insufficient. rustup takes the opposite approach of putting.
$HOME/.cargo/env` in every profile or rc file it can find, but that seems like it might be overkill.