]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/prepare_config.py
Convert ad hoc shell calls to singleton instance; fix upgrade bug.
[wizard.git] / wizard / command / prepare_config.py
index 5008b8500300b24dc2f846be28fa707dd8e351b6..13a4bc92910d28aaa8a99c6962d968d567cada77 100644 (file)
@@ -1,11 +1,18 @@
 import sys
+import os.path
 
 from wizard import command, deploy, shell
 
 def main(argv, baton):
     options, args = parse_args(argv, baton)
-    sh = shell.Shell()
     wc = deploy.WorkingCopy(".")
+    wc.verify()
+    wc.verifyConfigured()
+    # worst case scenario protection
+    for file in wc.application.parametrized_files:
+        shell.call("git", "add", file)
+    shell.call("git", "commit", "--allow-empty", "-am", "Protection commit")
+    shell.call("git", "reset", "HEAD~")
     wc.prepareConfig()
 
 def parse_args(argv, baton):