Mercurial > repos > yating-l > hubarchivecreator_test
diff hub-archive-creator/util/cleanDirectory.py @ 6:9193fe3ee73f draft default tip
Uploaded
author | yating-l |
---|---|
date | Thu, 22 Dec 2016 15:59:24 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hub-archive-creator/util/cleanDirectory.py Thu Dec 22 15:59:24 2016 -0500 @@ -0,0 +1,14 @@ +#!/usr/bin/python +"""Use to clean the directory after the run of HubArchiveCreator.py manually""" +import os +import shutil + +# Remove 'myHub.zip at root folder +try: + os.remove('myHub.zip') +except OSError as o: + # We don't need to crash the program + print 'Warning: ' + str(o) + +# Remove 'myHub' folder and its content +shutil.rmtree('myHub', ignore_errors=True)