Commit 57e03cdd authored by brkirch's avatar brkirch Committed by AUTOMATIC1111

Ensure the directory exists before saving to it

The directory for the images saved with the Save button may still not exist, so it needs to be created prior to opening the log.csv file.
parent 8aead63f
......@@ -131,6 +131,8 @@ def save_files(js_data, images, do_make_zip, index):
images = [images[index]]
start_index = index
os.makedirs(opts.outdir_save, exist_ok=True)
with open(os.path.join(opts.outdir_save, "log.csv"), "a", encoding="utf8", newline='') as file:
at_start = file.tell() == 0
writer = csv.writer(file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment