From 6a27e4388c84a947fd25460d584412d55f24233f Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Thu, 23 Jan 2020 09:17:27 -0800 Subject: [PATCH] Do update-profile even on an upgrade only (#1081) This helps users that are installing on an additional computer; it shouldn't cause any issue when upgrading an existing installation --- src/gam-install.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gam-install.sh b/src/gam-install.sh index 59de7801..c8663202 100755 --- a/src/gam-install.sh +++ b/src/gam-install.sh @@ -234,6 +234,18 @@ else echo_green "Finished extracting GAM archive." fi +# Update profile to add gam command +if [ "$update_profile" = true ]; then + alias_line="gam() { \"$target_dir/gam/gam\" \"\$@\" ; }" + if [ "$gamos" == "linux" ]; then + update_profile "$HOME/.bash_aliases" 0 || update_profile "$HOME/.bash_profile" 0 || update_profile "$HOME/.bashrc" 0 || update_profile "$HOME/.zshrc" 0 + elif [ "$gamos" == "macos" ]; then + update_profile "$HOME/.bash_aliases" 0 || update_profile "$HOME/.bash_profile" 0 || update_profile "$HOME/.bashrc" 0 || update_profile "$HOME/.zshrc" 0 || update_profile "$HOME/.profile" 1 + fi +else + echo_yellow "skipping profile update." +fi + if [ "$upgrade_only" = true ]; then echo_green "Here's information about your GAM upgrade:" "$target_dir/gam/gam" version extended @@ -247,18 +259,6 @@ if [ "$upgrade_only" = true ]; then exit fi -# Update profile to add gam command -if [ "$update_profile" = true ]; then - alias_line="gam() { \"$target_dir/gam/gam\" \"\$@\" ; }" - if [ "$gamos" == "linux" ]; then - update_profile "$HOME/.bash_aliases" 0 || update_profile "$HOME/.bash_profile" 0 || update_profile "$HOME/.bashrc" 0 || update_profile "$HOME/.zshrc" 0 - elif [ "$gamos" == "macos" ]; then - update_profile "$HOME/.bash_aliases" 0 || update_profile "$HOME/.bash_profile" 0 || update_profile "$HOME/.bashrc" 0 || update_profile "$HOME/.zshrc" 0 || update_profile "$HOME/.profile" 1 - fi -else - echo_yellow "skipping profile update." -fi - while true; do read -p "Can you run a full browser on this machine? (usually Y for MacOS, N for Linux if you SSH into this machine) " yn case $yn in