Skip to content

Commit

Permalink
webui creates data/ directories if they don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Wiggins authored and Roy Wiggins committed Oct 3, 2024
1 parent ace2f06 commit 7b9f43a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def validate_folders(config) -> Tuple[bool, str]:
config.success_folder, config.error_folder, config.discard_folder,
config.processing_folder, config.jobs_folder ):
if not Path(folder).is_dir():
return False, f"Folder {folder} does not exist."
try:
Path(folder).mkdir(parents=False)
print(f"Created directory: {folder}")
except Exception as e:
return False, f"Folder {folder} does not exist."

if not os.access( folder, os.R_OK | os.W_OK ):
return False, f"No read/write access to {folder}"
return True, ""
Expand Down

0 comments on commit 7b9f43a

Please sign in to comment.