From a44d4f0872acbfb60a5c0b73f082de14aa53418d Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Thu, 29 Mar 2018 09:07:05 -0400 Subject: [PATCH] Few fixes for gam alias --- src/gam-install.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gam-install.sh b/src/gam-install.sh index c611c10f..1b82848c 100755 --- a/src/gam-install.sh +++ b/src/gam-install.sh @@ -42,6 +42,9 @@ do esac done +# remove possible / from end of target_dir +target_dir=${target_dir%/} + update_profile() { [ -f "$1" ] || return 1 @@ -184,7 +187,7 @@ fi # Update profile to add gam command if [ "$update_profile" = true ]; then - alias_line="alias gam=\"$target_dir/gam/gam\"" + alias_line="gam() { \"$target_dir/gam/gam\" \"\$@\" ; }" if [ "$gamos" == "linux" ]; then update_profile "$HOME/.bashrc" || update_profile "$HOME/.bash_profile" elif [ "$gamos" == "macos" ]; then