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

minor cleanup and indentation

This commit is contained in:
Joël Schaerer 2010-07-19 11:12:10 +02:00
parent 937d60b875
commit 1da392bad3

View File

@ -22,9 +22,7 @@ function show_help {
# Default install directory. # Default install directory.
prefix=/usr prefix=/usr
#
# Command line parsing # Command line parsing
#
while true; do while true; do
case "$1" in case "$1" in
-h|--help|-\?) show_help; exit 0;; -h|--help|-\?) show_help; exit 0;;
@ -42,9 +40,7 @@ done
echo "Installing to ${prefix} ..." echo "Installing to ${prefix} ..."
#
# INSTALL AUTOJUMP # INSTALL AUTOJUMP
#
sudo mkdir -p ${prefix}/share/autojump/ sudo mkdir -p ${prefix}/share/autojump/
sudo cp icon.png ${prefix}/share/autojump/ sudo cp icon.png ${prefix}/share/autojump/
sudo cp jumpapplet ${prefix}/bin/ sudo cp jumpapplet ${prefix}/bin/
@ -71,21 +67,21 @@ else
if [ ${#ans} -gt 0 ]; then if [ ${#ans} -gt 0 ]; then
if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then
# Answered yes. Go ahead and add the autojump code # Answered yes. Go ahead and add the autojump code
echo "" >> ~/.bashrc echo "" >> ~/.bashrc
echo "#autojump" >> ~/.bashrc echo "#autojump" >> ~/.bashrc
cat autojump.bash >> ~/.bashrc cat autojump.bash >> ~/.bashrc
# Since OSX uses .bash_profile, we need to make sure that .bashrc is properly sourced. # Since OSX uses .bash_profile, we need to make sure that .bashrc is properly sourced.
# Makes the assumption that if they have a line: source ~/.bashrc or . ~/.bashrc, that # Makes the assumption that if they have a line: source ~/.bashrc or . ~/.bashrc, that
# .bashrc has been properly sourced and you don't need to add it. # .bashrc has been properly sourced and you don't need to add it.
OS=`uname` OS=`uname`
if [ $OS == 'Darwin' -a `grep -c "^[[:space:]]*source\|\. ~/\.bashrc[[:space:]]*$" ~/.bash_profile` -eq 0 ]; then if [ $OS == 'Darwin' -a `grep -c "^[[:space:]]*source\|\. ~/\.bashrc[[:space:]]*$" ~/.bash_profile` -eq 0 ]; then
echo "You are using OSX and your .bash_profile doesn't seem to be sourcing .bashrc" echo "You are using OSX and your .bash_profile doesn't seem to be sourcing .bashrc"
echo "Adding source ~/.bashrc to your bashrc" echo "Adding source ~/.bashrc to your bashrc"
echo -e "\n# Get the aliases and functions" >> ~/.bash_profile echo -e "\n# Get the aliases and functions" >> ~/.bash_profile
echo -e "if [ -f ~/.bashrc ]; then\n . ~/.bashrc\nfi" >> ~/.bash_profile echo -e "if [ -f ~/.bashrc ]; then\n . ~/.bashrc\nfi" >> ~/.bash_profile
fi fi
else else
echo "Then you need to put autojump.sh, or the code from it, somewhere where it will get read. Good luck!" echo "Then you need to put autojump.sh, or the code from it, somewhere where it will get read. Good luck!"
fi fi