]> git.donarmstrong.com Git - biopieces.git/commitdiff
added more control to appending of .bashrc in biopieces_installer.sh
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Sat, 22 Oct 2011 08:03:23 +0000 (08:03 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Sat, 22 Oct 2011 08:03:23 +0000 (08:03 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1594 74ccb610-7750-0410-82ae-013aeee3265d

bp_scripts/biopieces_installer.sh

index cbe5f9f6a877daeb2bb0fe2b59ed405afca896cb..c0f51c91e25d2afbc408ab6faf3a451fc8a36ceb 100755 (executable)
@@ -94,7 +94,7 @@ function prompt_install
     echo ""
     echo "      http://code.google.com/p/biopieces/wiki/Installation"
     echo ""
-    echo "   If you experience problems, please report to the Google Group (see below)"
+    echo "   If you experience problems, please report to the Google Group (see below)."
     echo ""
     echo "   The installer will now do the following:"
     echo ""
@@ -324,17 +324,43 @@ source \"\$BP_DIR/bp_conf/bashrc\"
     if [ $skip == 1 ]; then
         echo "Skipping"
     else
+        if [ -f "$HOME/.bashrc" ]; then
+            echo "Existing .bashrc file located: $HOME/.bashrc"
+            echo -n "Creating backup: "
+
+            if ! cp "$HOME/.bashrc" "$HOME/.bashrc_biopieces"; then
+                echo_red "FAIL"
+                abort
+            else
+                echo_green "OK"
+                echo "   Backup is $HOME/.bashrc_biopieces"
+            fi
+        fi
+
         echo -n "Appending $HOME/.bashrc: "
 
-        cp "$HOME/.bashrc" "$HOME/.bashrc_biopieces"
+        if ! echo "$section" >> "$HOME/.bashrc"; then
+            echo_red "FAIL"
+            abort
+        else
+            echo_green "OK"
+        fi
 
-        echo "$section" >> "$HOME/.bashrc"
+        echo -n "Sourcing $HOME/.bashrc: "
 
-        source "$HOME/.bashrc"
+        if ! source "$HOME/.bashrc"; then
+            echo_red "FAIL"
+            abort
+        else
+            echo_green "OK"
+        fi
 
-        echo_green "OK"
         echo ""
-        echo "   Backup is $HOME/.bashrc_biopieces"
+        echo "   \$BP_DIR is now set to: $BP_DIR"
+        echo "   \$BP_DATA is now set to: $BP_DATA"
+        echo "   \$BP_TMP is now set to: $BP_TMP"
+        echo "   \$BP_LOG is now set to: $BP_LOG"
+        echo ""
     fi
 }