Skip to content

Commit

Permalink
Check site exists before clearing it
Browse files Browse the repository at this point in the history
  • Loading branch information
Dataliberate committed Sep 10, 2020
1 parent 7e58f07 commit 6627672
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions util/buildsite.py
Expand Up @@ -69,11 +69,12 @@
def clear():
if args.clearfirst or args.autobuild:
print("Clearing %s directory" % OUTPUTDIR)
for root, dirs, files in os.walk(OUTPUTDIR):
for f in files:
os.unlink(os.path.join(root, f))
for d in dirs:
shutil.rmtree(os.path.join(root, d))
if os.path.isdir(OUTPUTDIR):
for root, dirs, files in os.walk(OUTPUTDIR):
for f in files:
os.unlink(os.path.join(root, f))
for d in dirs:
shutil.rmtree(os.path.join(root, d))

###################################################
#RUN TESTS
Expand Down

0 comments on commit 6627672

Please sign in to comment.