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

Merge pull request #104 from wting/dynamic_fpath

Traverse fpath when installing/uninstalling _j
This commit is contained in:
Joel Schaerer 2012-02-09 01:43:27 -08:00
commit 8e86f08625
2 changed files with 13 additions and 2 deletions

View File

@ -117,7 +117,10 @@ if [ ! ${local} ]; then
# install _j to the first accessible directory # install _j to the first accessible directory
if [ ${shell} == "zsh" ]; then if [ ${shell} == "zsh" ]; then
success= success=
cp -v _j /usr/local/share/zsh/site-functions/ && success=true fpath=`/usr/bin/env zsh -c 'echo $fpath'`
for f in ${fpath}; do
cp -v _j ${f} && success=true && break
done
if [ ! ${success} ]; then if [ ! ${success} ]; then
echo echo

View File

@ -73,14 +73,22 @@ if [ -d "${prefix}/share/autojump/" ]; then
sudo rm -v ${prefix}/bin/autojump sudo rm -v ${prefix}/bin/autojump
sudo rm -v ${prefix}/share/man/man1/autojump.1 sudo rm -v ${prefix}/share/man/man1/autojump.1
sudo rm -v /etc/profile.d/autojump.sh sudo rm -v /etc/profile.d/autojump.sh
sudo rm -v /usr/local/share/zsh/site-functions/_j
if [ -f /etc/profile.d/autojump.bash ]; then if [ -f /etc/profile.d/autojump.bash ]; then
sudo rm -v /etc/profile.d/autojump.bash sudo rm -v /etc/profile.d/autojump.bash
remove_msg "global" "bash" remove_msg "global" "bash"
fi fi
if [ -f /etc/profile.d/autojump.zsh ]; then if [ -f /etc/profile.d/autojump.zsh ]; then
sudo rm -v /etc/profile.d/autojump.zsh sudo rm -v /etc/profile.d/autojump.zsh
fpath=`/usr/bin/env zsh -c 'echo $fpath'`
for f in ${fpath}; do
if [[ -f ${f}/_j ]]; then
sudo rm -v ${f}/_j
fi
done
remove_msg "global" "zsh" remove_msg "global" "zsh"
fi fi
fi fi