Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Couple of minor tweaks to fabfile

  • Loading branch information...
commit 171b682a9d7205feb3cd64e6b07b095357a4f898 1 parent 0c4a4ed
David Winterbottom authored July 03, 2012

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. 8  fabfile.py
8  fabfile.py
... ...
@@ -1,8 +1,7 @@
1 1
 import datetime
2 2
 import os
3  
-from os.path import normpath
4 3
 
5  
-from fabric.decorators import runs_once, roles, task
  4
+from fabric.decorators import runs_once
6 5
 from fabric.operations import put, prompt
7 6
 from fabric.colors import green, red
8 7
 from fabric.api import local, cd, sudo
@@ -180,12 +179,15 @@ def unpack(archive_path):
180 179
     Unpacks the tarball into the correct place but doesn't switch
181 180
     the symlink
182 181
     """
  182
+    # Ensure all folders are in place
  183
+    sudo('if [ ! -d "%(builds_dir)s" ]; then mkdir -p "%(builds_dir)s"; fi' % env)
  184
+
183 185
     notify("Creating remote build folder")
184 186
     with cd(env.builds_dir):
185 187
         sudo('tar xzf %s' % archive_path)
186 188
 
187 189
         # Create new build folder
188  
-        sudo('if [ -d "%(build_dir)s" ]; then rm -rf "%(build_dir)s"; fi'% env)
  190
+        sudo('if [ -d "%(build_dir)s" ]; then rm -rf "%(build_dir)s"; fi' % env)
189 191
         sudo('mv %(web_dir)s %(build_dir)s' % env)
190 192
 
191 193
         # Symlink in uploads folder

0 notes on commit 171b682

Please sign in to comment.
Something went wrong with that request. Please try again.