mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Update gam-install.sh to set .profile on a Mac as a default (#1079)
This commit is contained in:
@@ -52,7 +52,7 @@ done
|
|||||||
target_dir=${target_dir%/}
|
target_dir=${target_dir%/}
|
||||||
|
|
||||||
update_profile() {
|
update_profile() {
|
||||||
[ -f "$1" ] || return 1
|
[ $2 -eq 1 ] || [ -f "$1" ] || return 1
|
||||||
|
|
||||||
grep -F "$alias_line" "$1" > /dev/null 2>&1
|
grep -F "$alias_line" "$1" > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -251,9 +251,9 @@ fi
|
|||||||
if [ "$update_profile" = true ]; then
|
if [ "$update_profile" = true ]; then
|
||||||
alias_line="gam() { \"$target_dir/gam/gam\" \"\$@\" ; }"
|
alias_line="gam() { \"$target_dir/gam/gam\" \"\$@\" ; }"
|
||||||
if [ "$gamos" == "linux" ]; then
|
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
|
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
|
fi
|
||||||
else
|
else
|
||||||
echo_yellow "skipping profile update."
|
echo_yellow "skipping profile update."
|
||||||
|
|||||||
Reference in New Issue
Block a user