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

hardcoded _j copy to distro default function location for global zsh installs

This commit is contained in:
William Ting 2012-02-08 09:55:36 -10:00
parent b4c6dcc419
commit 02262b9089
2 changed files with 16 additions and 18 deletions

View File

@ -27,7 +27,7 @@ function add_msg {
fi
echo
echo "You need to 'source ~/.${2}rc' before you can start using autojump."
echo "You need to run 'source ~/.${2}rc' before you can start using autojump."
echo
echo "To remove autojump, run './uninstall.sh'"
echo
@ -115,16 +115,13 @@ if [ ! ${local} ]; then
# install _j to the first accessible directory
if [ ${shell} == "zsh" ]; then
success=
for f in ${fpath}
do
cp _j $f && success=true && break
done
cp -v _j /usr/local/share/zsh/site-functions/ $f && success=true
if [ ${success} ]; then
echo "Installed autocompletion file to ${f}"
else
if [ ! ${success} ]; then
echo
echo "Couldn't find a place to put the autocompletion file, please copy _j into your \$fpath"
echo "Still trying to install the rest of autojump..."
echo "Installing the rest of autojump ..."
echo
fi
fi

View File

@ -19,17 +19,18 @@ function help_msg {
echo "sudo ./uninstall.sh [--prefix /usr/local]"
}
# zsh: remove _j from fpath
function remove_j {
# zsh: remove _j from fpath, only works within zsh
# autocompletion file in the first directory of the FPATH variable
fail=true
for f in $fpath
do
if [ -f ${f}/_j ]; then
rm -v ${f}/_j || sudo rm -v ${f}/_j
break
fi
done
#fail=true
#for f in $fpath
#do
#if [ -f ${f}/_j ]; then
#rm -v ${f}/_j || sudo rm -v ${f}/_j
#break
#fi
#done
sudo rm -v /usr/local/share/zsh/site-functions/_j
}
function remove_msg {