Commits

Shrikant Sharat Kandula committed 4d9cb87

Fixed problems with new deployment

Comments (0)

Files changed (1)

             self.cmds.append(tline.line)
 
     def apply(self):
-        url = self.line.split()[0]
+        self.url = url = self.line.split()[0]
         arg = self.line.lstrip(url)
 
         # Detect the vcs to use
 
     def _run_cmds(self):
         previous_pwd = os.path.abspath('.')
-        os.chdir(self.dest_dir)
+        in_dest_dir = False
+        if os.path.exists(self.dest_dir):
+            os.chdir(self.dest_dir)
+            in_dest_dir = True
         for cmd in self.cmds:
             print cmd
             sp.call(cmd, shell=True)
+            if not in_dest_dir and os.path.exists(self.dest_dir):
+                os.chdir(self.dest_dir)
+                in_dest_dir = True
         os.chdir(previous_pwd)
 
     def _vcs_hg(self):