Skip to content

Commit 7b5260e

Browse files
committed
Adds clean command to fab script
1 parent b2a6ae0 commit 7b5260e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

fabfile.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import os.path
2+
import shutil
3+
14
from fabric.api import local, lcd, puts, abort
25

36

@@ -12,6 +15,14 @@ def upload():
1215
local('python setup.py sdist register upload')
1316

1417

18+
def clean():
19+
puts("* Cleaning Repo")
20+
dirs = ['.tox', 'SoftLayer.egg-info', 'build', 'dist']
21+
for d in dirs:
22+
if os.path.exists(d) and os.path.isdir(d):
23+
shutil.rmtree(d)
24+
25+
1526
def release(version, force=False):
1627
"""Perform a release. Example:
1728
@@ -22,6 +33,8 @@ def release(version, force=False):
2233
abort("Version should not start with 'v'")
2334
version_str = "v%s" % version
2435

36+
clean()
37+
2538
puts(" * Tagging Version %s" % version_str)
2639
f = 'f' if force else ''
2740
local("git tag -%sam \"%s\" %s" % (f, version_str, version_str))

0 commit comments

Comments
 (0)