Skip to content
Snippets Groups Projects
Commit c36143c0 authored by Mitchel Humpherys's avatar Mitchel Humpherys
Browse files

lrdp-v2: create output directory if it doesn't exist

Currently we error out and ask the user to create the output directory
if it doesn't exist. As a convenience, just create the directory for
them.

Change-Id: I0e9caa8294d644621bd166a06e2a70c8ca5715fc
parent b70d9718
No related branches found
No related tags found
No related merge requests found
......@@ -91,8 +91,12 @@ if __name__ == '__main__':
if options.outdir:
if not os.path.exists(options.outdir):
print ('!!! Out directory does not exist. Create it first.')
sys.exit(1)
print ('!!! Out directory does not exist. Creating...')
try:
os.makedirs(options.outdir)
except:
print ("Failed to create %s. You probably don't have permissions there. Bailing." % options.outdir)
sys.exit(1)
else:
options.outdir = '.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment