From 2a3fbd468772ee3139ae46f501f0eb95ae260a72 Mon Sep 17 00:00:00 2001 From: William Ting Date: Thu, 15 Mar 2012 11:00:43 -1000 Subject: [PATCH] change default line to add to .bashrc/.zshrc message --- install.sh | 4 ++-- uninstall.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 7ee9dae..14eccaf 100755 --- a/install.sh +++ b/install.sh @@ -21,9 +21,9 @@ function add_msg { echo if [ "${1}" == "global" ]; then - echo -e "\tsource /etc/profile.d/autojump.${2}" + echo -e "\t[[ -f /etc/profile.d/autojump.${2} ]] && source /etc/profile.d/autojump.${2}" elif [ "${1}" == "local" ]; then - echo -e "\tsource ~/.autojump/etc/profile.d/autojump.${2}" + echo -e "\t[[ -f ~/.autojump/etc/profile.d/autojump.${2} ]] && source ~/.autojump/etc/profile.d/autojump.${2}" fi echo diff --git a/uninstall.sh b/uninstall.sh index 36af222..2568cc6 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -24,9 +24,9 @@ function remove_msg { echo "Please remove the line from .${2}rc :" echo if [ "${1}" == "global" ]; then - echo -e "\tsource /etc/profile.d/autojump.${2}" + echo -e "\t[[ -f /etc/profile.d/autojump.${2} ]] && source /etc/profile.d/autojump.${2}" elif [ "${1}" == "local" ]; then - echo -e "\tsource ~/.autojump/etc/profile.d/autojump.${2}" + echo -e "\t[[ -f ~/.autojump/etc/profile.d/autojump.${2} ]] && source ~/.autojump/etc/profile.d/autojump.${2}" fi echo }