Skip to content

Commit

Permalink
Bug fix to handle output directory creation
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchodora committed Apr 25, 2018
1 parent 1116868 commit 9f58c83
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Slicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,12 @@ def slice_geometry(self):
if space <= 0:
space = 0.1

# Try to delete previous output files (SVGs and path CSV) if they exist
# Make sure the output directory exists for saving the outputs
outputdir = 'outputs'
if not os.path.exists(outputdir):
os.makedirs(outputdir)

# Try to delete previous output files (SVGs and path CSV) if they exist
try:
list(map(os.unlink, (os.path.join(outputdir, f) for f in os.listdir(outputdir))))
except OSError:
Expand Down

0 comments on commit 9f58c83

Please sign in to comment.