Skip to content
Snippets Groups Projects
Commit 264fcdc5 authored by Lionel GUEZ's avatar Lionel GUEZ
Browse files

Move rmtree after processing of arguments

The script may abort because of wrong arguments. It is better not to
have touched anything in that case.
parent f2ee50c9
No related branches found
No related tags found
No related merge requests found
......@@ -33,10 +33,6 @@ inst_eddies_exe = "@CMAKE_CURRENT_BINARY_DIR@/inst_eddies"
if not os.access(inst_eddies_exe, os.X_OK):
sys.exit(inst_eddies_exe + " not found or not executable")
for orient in ["cyclo", "anti"]:
if os.access(f"SHPC_{orient}_all_dates", os.F_OK):
shutil.rmtree(f"SHPC_{orient}_all_dates")
dirname, basename = path.split(args.first_file)
my_date = datetime.datetime.strptime(basename, args.template).date()
nc_file = args.first_file
......@@ -47,6 +43,10 @@ if args.last_date:
else:
last_date = my_date
for orient in ["cyclo", "anti"]:
if os.access(f"SHPC_{orient}_all_dates", os.F_OK):
shutil.rmtree(f"SHPC_{orient}_all_dates")
while True:
print("inst_eddies.py: Date:", my_date)
......
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