diff --git a/src/gam-install.sh b/src/gam-install.sh index 05eb2d92..59de7801 100755 --- a/src/gam-install.sh +++ b/src/gam-install.sh @@ -52,7 +52,7 @@ done target_dir=${target_dir%/} update_profile() { - [ -f "$1" ] || return 1 + [ $2 -eq 1 ] || [ -f "$1" ] || return 1 grep -F "$alias_line" "$1" > /dev/null 2>&1 if [ $? -ne 0 ]; then @@ -251,9 +251,9 @@ fi if [ "$update_profile" = true ]; then alias_line="gam() { \"$target_dir/gam/gam\" \"\$@\" ; }" if [ "$gamos" == "linux" ]; then - update_profile "$HOME/.bashrc" || update_profile "$HOME/.bash_profile" + 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/.profile" || update_profile "$HOME/.bash_profile" + 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."