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

pull/101/head
William Ting 13 years ago
parent b4c6dcc419
commit 02262b9089

@ -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
if [ ${success} ]; then
echo "Installed autocompletion file to ${f}"
else
cp -v _j /usr/local/share/zsh/site-functions/ $f && success=true
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

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

Loading…
Cancel
Save