Repository: climate
Updated Branches:
  refs/heads/master ab179cbee -> 79f20d4ab


Add check for existing ocw virtualenv


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/b90e1628
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/b90e1628
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/b90e1628

Branch: refs/heads/master
Commit: b90e1628ddaf283ddaecc9163fe9e6395b4d30a7
Parents: ab179cb
Author: cgoodale <[email protected]>
Authored: Thu Jun 19 21:55:29 2014 -0700
Committer: cgoodale <[email protected]>
Committed: Thu Jun 19 21:55:29 2014 -0700

----------------------------------------------------------------------
 easy-ocw/install-osx.sh | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/b90e1628/easy-ocw/install-osx.sh
----------------------------------------------------------------------
diff --git a/easy-ocw/install-osx.sh b/easy-ocw/install-osx.sh
index 1e6a248..ca7581f 100755
--- a/easy-ocw/install-osx.sh
+++ b/easy-ocw/install-osx.sh
@@ -131,6 +131,30 @@ if [ $WITH_VIRTUAL_ENV == 1 ]; then
         subtask "done"
     fi
 
+    header "Checking for previously installed  ocw virtual environment..."
+    if [ -e ~/ocw/bin/python ]; then
+        echo "We found an existing 'ocw' virtualenv on your system in ~/ocw."
+        read -n1 -p "Do you want to replace it with a clean install? y/n :" 
replace 
+        if [ "$replace" == "y" ]; then
+            echo ""
+            echo "WARNING this will delete all file and data in ~/ocw on your 
system."
+            read  -p "To confirm and proceed type YES or ENTER to quit:" 
confirm
+            if [ "$confirm" == "YES" ]; then
+                echo "Deleting contents of ~/ocw" >> install_log
+                rm -rf ~/ocw
+            else
+                echo ""
+                echo "Stopping Open Climate Workbench Installation"
+                exit
+            fi
+        else
+            echo ""
+            echo "Stopping Open Climate Workbench Installation because an 
existing 'ocw'"
+            echo "virtual environment already exists."
+            exit
+        fi
+    fi
+
     # Create a new environment for OCW work
     task "Creating a new environment in ~/ocw..."
     cd ~

Reply via email to