1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00
This commit is contained in:
Joël Schaerer 2011-11-30 10:24:25 +01:00
parent 2832519a99
commit f64b990d6a

View File

@ -24,12 +24,13 @@ prefix=/usr
user=${SUDO_USER:-${USER}} user=${SUDO_USER:-${USER}}
OS=`uname` OS=`uname`
if [ $OS == 'Darwin' ]; then if [ $OS == 'Darwin' ]; then
user_home=$(dscl . -search /Users UniqueID ${user} | cut -d: -f6) user_home=$(dscl . -search /Users UniqueID ${user} | cut -d: -f6)
else else
user_home=$(getent passwd ${user} | cut -d: -f6) user_home=$(getent passwd ${user} | cut -d: -f6)
fi fi
bashrc_file=${user_home}/.bashrc bashrc_file=${user_home}/.bashrc
# Command line parsing # Command line parsing
while true; do while true; do
@ -91,7 +92,6 @@ else
# 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 [ $OS == 'Darwin' -a x`grep -c "^[[:space:]]*\(source\|\.\) ~/\.bashrc[[:space:]]*$" ~/.bash_profile` == x0 ]; then if [ $OS == 'Darwin' -a x`grep -c "^[[:space:]]*\(source\|\.\) ~/\.bashrc[[:space:]]*$" ~/.bash_profile` == x0 ]; 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"