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 fi
echo 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
echo "To remove autojump, run './uninstall.sh'" echo "To remove autojump, run './uninstall.sh'"
echo echo
@ -115,16 +115,13 @@ 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=
for f in ${fpath} cp -v _j /usr/local/share/zsh/site-functions/ $f && success=true
do
cp _j $f && success=true && break
done
if [ ${success} ]; then if [ ! ${success} ]; then
echo "Installed autocompletion file to ${f}" echo
else
echo "Couldn't find a place to put the autocompletion file, please copy _j into your \$fpath" 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
fi fi

View File

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