Skip to content

Commit

Permalink
make zsh installer more robust to fpath problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Schaerer committed Aug 18, 2010
1 parent e60f35d commit 512db41
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ while true; do
esac
done

echo "Installing to ${prefix} ..."
echo "Installing main files to ${prefix} ..."

sudo mkdir -p ${prefix}/share/autojump/
sudo cp icon.png ${prefix}/share/autojump/
Expand All @@ -46,7 +46,18 @@ sudo cp autojump ${prefix}/bin/
sudo cp autojump.1 ${prefix}/share/man/man1/

# autocompletion file in the first directory of the FPATH variable
sudo cp _j $(echo $FPATH | cut -d":" -f 1)
fail=true
for f in $fpath
do
sudo cp _j $f && fail=false && break
done
if $fail
then
echo "Couldn't find a place to put the autocompletion file :-("
echo "Still trying to install the rest of autojump..."
else
echo "Installed autocompletion file to $f"
fi

if [ -d "/etc/profile.d" ]; then
sudo cp autojump.zsh /etc/profile.d/
Expand Down

0 comments on commit 512db41

Please sign in to comment.