1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

test for ~/.autojump/bin within .bashrc PATH and add if necessary for single user installs

This commit is contained in:
William Ting 2011-05-13 19:48:51 -10:00
parent 69fb7bb792
commit 6ac2bd897c
2 changed files with 12 additions and 0 deletions

View File

@ -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'

View File

@ -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!"