mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
fixed bugs in itegrate master version when publishing first version
This commit is contained in:
parent
a364b90ae3
commit
7d614c616d
1 changed files with 5 additions and 2 deletions
|
|
@ -202,6 +202,7 @@ class IntegrateMasterVersion(pyblish.api.InstancePlugin):
|
|||
repre_name_low = repre["name"].lower()
|
||||
archived_repres_by_name[repre_name_low] = repre
|
||||
|
||||
backup_master_publish_dir = str(master_publish_dir)
|
||||
if os.path.exists(master_publish_dir):
|
||||
backup_master_publish_dir = master_publish_dir + ".BACKUP"
|
||||
max_idx = 10
|
||||
|
|
@ -401,10 +402,12 @@ class IntegrateMasterVersion(pyblish.api.InstancePlugin):
|
|||
)
|
||||
|
||||
# Remove backuped previous master
|
||||
shutil.rmtree(backup_master_publish_dir)
|
||||
if os.path.exists(backup_master_publish_dir):
|
||||
shutil.rmtree(backup_master_publish_dir)
|
||||
|
||||
except Exception:
|
||||
os.rename(backup_master_publish_dir, master_publish_dir)
|
||||
if os.path.exists(backup_master_publish_dir):
|
||||
os.rename(backup_master_publish_dir, master_publish_dir)
|
||||
self.log.error((
|
||||
"!!! Creating of Master version failed."
|
||||
" Previous master version maybe lost some data!"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue