2
#Copyright Joel Schaerer 2008, 2009
3
#This file is part of autojump
5
#autojump is free software: you can redistribute it and/or modify
6
#it under the terms of the GNU General Public License as published by
7
#the Free Software Foundation, either version 3 of the License, or
8
#(at your option) any later version.
10
#autojump is distributed in the hope that it will be useful,
11
#but WITHOUT ANY WARRANTY; without even the implied warranty of
12
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
#GNU General Public License for more details.
15
#You should have received a copy of the GNU General Public License
16
#along with autojump. If not, see <http://www.gnu.org/licenses/>.
19
echo "sudo ./install.sh [--prefix /usr/local]"
27
-h|--help|-\?) show_help; exit 0;;
28
-p|--prefix) if [ $# -gt 1 ]; then
31
echo "--prefix or -p require an argument" 1>&2
35
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
40
echo "Installing to ${prefix} ..."
42
sudo mkdir -p ${prefix}/share/autojump/
43
sudo cp icon.png ${prefix}/share/autojump/
44
sudo cp jumpapplet ${prefix}/bin/
45
sudo cp autojump ${prefix}/bin/
46
sudo cp autojump.1 ${prefix}/share/man/man1/
48
# autocompletion file in the first directory of the FPATH variable
49
sudo cp _j $(echo $FPATH | cut -d":" -f 1)
51
if [ -d "/etc/profile.d" ]; then
52
sudo cp autojump.zsh /etc/profile.d/
53
sudo cp autojump.sh /etc/profile.d/
54
echo "Remember to add the line"
55
echo " source /etc/profile.d/autojump.zsh"
57
echo " source /etc/profile"
58
echo "to your ~/.zshrc if it's not there already"
60
echo "Your distribution does not have a /etc/profile.d directory, the default that we install one of the scripts to. Would you like us to copy it into your ~/.zshrc file to make it work? (If you have done this once before, delete the old version before doing it again.) [y/n]"
62
if [ ${#ans} -gt 0 ]; then
63
if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then
65
echo "#autojump" >> ~/.zshrc
66
cat autojump.zsh >> ~/.zshrc
68
echo "Then you need to put autojump.zsh, or the code from it, somewhere where it will get read. Good luck!"
71
echo "Then you need to put autojump.zsh, or the code from it, somewhere where it will get read. Good luck!"