mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
version_up_current_workfile: Raise error if parent folder of the workfile doesn't exist.
This commit is contained in:
parent
65d7404d42
commit
817e4dc338
1 changed files with 8 additions and 0 deletions
|
|
@ -623,4 +623,12 @@ def version_up_current_workfile():
|
|||
new_workfile_path = last_workfile_path
|
||||
if os.path.exists(new_workfile_path):
|
||||
new_workfile_path = version_up(new_workfile_path)
|
||||
|
||||
# Raise an error if the parent folder doesn't exist as `host.save_workfile`
|
||||
# is not supposed/able to create missing folders.
|
||||
parent_folder = os.path.dirname(new_workfile_path)
|
||||
if not os.path.exists(parent_folder):
|
||||
raise AssertionError(
|
||||
f"Folder {parent_folder} does not exist yet.")
|
||||
|
||||
host.save_workfile(new_workfile_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue