mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
fixed and tested single user / all user installation on OS X.
This commit is contained in:
parent
6ac2bd897c
commit
71f3d876c9
26
install.sh
26
install.sh
@ -73,7 +73,6 @@ fi
|
|||||||
echo "Installing to ${prefix} ..."
|
echo "Installing to ${prefix} ..."
|
||||||
|
|
||||||
# INSTALL AUTOJUMP
|
# INSTALL AUTOJUMP
|
||||||
if [ `uname` != "Darwin" ]; then
|
|
||||||
if [ ${all_users} == 1 ]; then
|
if [ ${all_users} == 1 ]; then
|
||||||
sudo mkdir -p ${prefix}/share/autojump/
|
sudo mkdir -p ${prefix}/share/autojump/
|
||||||
sudo mkdir -p ${prefix}/bin/
|
sudo mkdir -p ${prefix}/bin/
|
||||||
@ -135,33 +134,12 @@ if [ `uname` != "Darwin" ]; then
|
|||||||
echo
|
echo
|
||||||
echo "You need to source your ~/.bashrc (source ~/.bashrc) before you can start using autojump."
|
echo "You need to source your ~/.bashrc (source ~/.bashrc) before you can start using autojump."
|
||||||
|
|
||||||
else
|
|
||||||
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 ~/.bashrc file to make it work? (If you have done this once before, delete the old version before doing it again.) [y/n]"
|
|
||||||
|
|
||||||
read ans
|
|
||||||
if [ ${#ans} -gt 0 ]; then
|
|
||||||
if [ $ans = "y" -o $ans = "Y" -o $ans = "yes" -o $ans = "Yes" ]; then
|
|
||||||
|
|
||||||
# Answered yes. Go ahead and add the autojump code
|
|
||||||
echo "" >> ~/.bashrc
|
|
||||||
echo "#autojump" >> ~/.bashrc
|
|
||||||
cat autojump.bash | grep -v "^#" >> ~/.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`
|
if [ `uname` == "Darwin" ] && [ `grep -c "^[[:space:]]*\(source\|\.\).*\.bashrc[[:space:]]*$" ~/.bash_profile` -eq 0 ]; then
|
||||||
if [ $OS == 'Darwin' -a `grep -c "^[[:space:]]*\(source\|\.\) /etc/profile\(\.d/autojump\.bash\)[[:space:]]*$" ~/.bash_profile` -eq 0 ]; then
|
echo "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
|
||||||
echo "You need to source your ~/.bashrc (source ~/.bashrc) before you can start using autojump."
|
|
||||||
else
|
|
||||||
echo "Then you need to put autojump.sh, or the code from it, somewhere where it will get read. Good luck!"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Then you need to put autojump.sh, or the code from it, somewhere where it will get read. Good luck!"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue
Block a user