diff --git a/.gitignore b/.gitignore index 9d6eb16..95c1177 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ data-sub/ build/ dist/ podaac_data_subscriber.egg-info/ -.idea/ \ No newline at end of file +.idea/ +venv \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index deb60fb..be85a66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Changed - created library of common access mechanisms to split between subscriber and downloader capabilities - added .tar.gz to list of default extensions. [40](https://github.com/podaac/data-subscriber/issues/40) +- Ignore error if destination directory already exists. [46](https://github.com/podaac/data-subscriber/issues/46) ### Deprecated ### Removed ### Fixed diff --git a/subscriber/podaac_access.py b/subscriber/podaac_access.py index 039905d..0bdf10b 100644 --- a/subscriber/podaac_access.py +++ b/subscriber/podaac_access.py @@ -149,7 +149,7 @@ def validate(args): def check_dir(path): if not isdir(path): - makedirs(path) + makedirs(path, exist_ok=True) def prepare_time_output(times, prefix, file, args, ts_shift): diff --git a/subscriber/podaac_data_downloader.py b/subscriber/podaac_data_downloader.py index 731f1fc..e058bcf 100644 --- a/subscriber/podaac_data_downloader.py +++ b/subscriber/podaac_data_downloader.py @@ -94,7 +94,7 @@ def run(): if not isdir(data_path): print("NOTE: Making new data directory at " + data_path + "(This is the first run.)") - makedirs(data_path) + makedirs(data_path, exist_ok=True) # Change this to whatever extent you need. Format is W Longitude,S Latitude,E Longitude,N Latitude bounding_extent = args.bbox diff --git a/subscriber/podaac_data_subscriber.py b/subscriber/podaac_data_subscriber.py index 72f09de..5ecab59 100755 --- a/subscriber/podaac_data_subscriber.py +++ b/subscriber/podaac_data_subscriber.py @@ -123,7 +123,7 @@ def run(): if not isdir(data_path): print("NOTE: Making new data directory at " + data_path + "(This is the first run.)") - makedirs(data_path) + makedirs(data_path, exist_ok=True) else: try: with open(data_path + "/.update", "r") as f: