Skip to content

Commit

Permalink
Now checks directory exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sambowers committed Feb 6, 2018
1 parent 69ae15b commit 5e116cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions biota/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def download(url, output_dir = os.getcwd()):
# Check that output file doesn't already exist
assert not os.path.exists('%s/%s'%(output_dir,url.split('/')[-1])), "File %s already exists at output location."%url.split('/')[-1]

# Check that output directory exists
assert os.path.isdir(output_dir), "The output directory (%s) does not exist. Create it, then try again."%output_dir

# Download
exit_status = subprocess.call(['wget', '-nc', url, '-P', output_dir])

Expand Down

0 comments on commit 5e116cd

Please sign in to comment.