Commits

David Wolever  committed a090615

profile works, added -n option to install_links, everything is peachy :)

  • Participants
  • Parent commits 29eef5e

Comments (0)

Files changed (5)

File bash_profile

-source ~/.profile
+# bashrc will source profile... Then we'll be peachy.
+source ~/.bashrc
 # Make sure the profile gets loaded first
-echo "Loading bashrc"
-if [[ ! $PROFILE_LOADED ]]; then
-    source ~/.profile
-    return
-fi
+source ~/.profile
 
 export PS1="\[\e[32m\][\[\e[0;31m\]\u\[\e[0;32m\]@\[\e[0;34m\]\h\[\e[0;32m\]] \[\e[0;33m\]\w\[\e[0m\] ";
 

File install_links.sh

     DOTFILE="$HOME/.$FILE"
     if [[ -e "$DOTFILE" || -h "$DOTFILE" ]]
     then
-        read -p "$FILE already exists.  Backup then replace? [yN] " RESP 
+        if [[ $NO_REPLACE ]]
+        then
+            RESP=n
+        else
+            read -p "$FILE already exists.  Backup then replace? [yN] " RESP 
+        fi
         if [[ "$RESP" != "y" && "$RESP" != "Y" ]]
         then
             echo "Not replacing $DOTFILE"
     echo "$FILE --> $DOTFILE"
 }
 
+if [[ "$1" == "-n" ]]
+then
+    NO_REPLACE=1
+fi
+
 for FILE in *
 do
     if [[ "$FILE" != "`basename $0`" ]]
 # The all-mighty profile!
 #  It will always get loaded before the zshrc or bashrc
-echo "Loading profile"
+#   (or, at least, bashrc and zshrc will source it)
+
 if [[ $- != *i* ]] ; then
-	return
+	exit 1
 fi
 
 # We will never get farther than this unless we are at an interactive prompt
 
-if [[ $PROFILE_LOADED ]]; then
-    echo "Not loading twice..."
-    return
-fi
-
 export PROFILE_LOADED=1
 
 export CDF="g7woleve@cdf.toronto.edu"
 export NAME="David Wolever"
 export EDITOR="vim"
 
-export TERM="xterm-color"
-export TERMINFO="$HOME/.terminfo"
+# These should be local on machines that don't like the mac's terminal
+#export TERM="xterm-color" 
+#export TERMINFO="$HOME/.terminfo"
 
 # don't put duplicate lines in the history. See bash(1) for more options
 export HISTCONTROL=ignoredups
-if [[ ! $PROFILE_LOADED ]]; then
-    source ~/.profile
-    return
-fi
+# Make sure the profile gets loaded first
+source ~/.profile
 
 # http://people.debian.org/~falk/zshrc