From 6ac2bd897c43d98105a2bf13cec22052cbda2915 Mon Sep 17 00:00:00 2001 From: William Ting Date: Fri, 13 May 2011 19:48:51 -1000 Subject: [PATCH] test for ~/.autojump/bin within .bashrc PATH and add if necessary for single user installs --- autojump.bash | 3 +++ install.sh | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/autojump.bash b/autojump.bash index f83cc97..d0e6586 100644 --- a/autojump.bash +++ b/autojump.bash @@ -30,6 +30,9 @@ export AUTOJUMP_HOME=${HOME} export AUTOJUMP_DATA_DIR=${HOME}/.autojump if [ ! -d ${AUTOJUMP_DATA_DIR} ]; then mkdir -p ${AUTOJUMP_DATA_DIR} + mv ~/.autojump_py "${AUTOJUMP_DATA_DIR}/autojump_py" 2>>/dev/null #migration + mv ~/.autojump_py.bak "${AUTOJUMP_DATA_DIR}/autojump_py.bak" 2>>/dev/null + mv ~/.autojump_errors "${AUTOJUMP_DATA_DIR}/autojump_errors" 2>>/dev/null fi AUTOJUMP='{ [[ "$AUTOJUMP_HOME" == "$HOME" ]] && (autojump -a "$(pwd -P)"&)>/dev/null 2>>${AUTOJUMP_DATA_DIR}/autojump_errors;} 2>/dev/null' diff --git a/install.sh b/install.sh index 0b70156..d4d7ce6 100755 --- a/install.sh +++ b/install.sh @@ -120,6 +120,15 @@ if [ `uname` != "Darwin" ]; then echo "# Added by autojump install.sh" >> ~/.bashrc echo "source ${prefix}/etc/profile.d/autojump.bash" >> ~/.bashrc fi + + if [ `grep -c ".*PATH.*.autojump/bin" ~/.bashrc` -eq 0 ]; then + echo "Your .bashrc doesn't seem to have ${prefix}/bin in your \$PATH" + echo "Adding the ${prefix}/bin/ to your PATH" + echo "" >> ~/.bashrc + echo "# Added by autojump install.sh" >> ~/.bashrc + echo 'export PATH=${PATH}:~/.autojump/bin' >> ~/.bashrc + fi + fi echo "Done!"