diff --git a/colorbleed/plugins/publish/cleanup.py b/colorbleed/plugins/publish/cleanup.py index e69de29bb2..58e86d9415 100644 --- a/colorbleed/plugins/publish/cleanup.py +++ b/colorbleed/plugins/publish/cleanup.py @@ -0,0 +1,20 @@ +import os + +from pyblish import api + + +class CleanUp(api.InstancePlugin): + """Cleans up the staging directory after a successful publish + + """ + + order = api.IntegratorOrder + 10 + + def process(self, instance): + return + + def clean_up(self, instance): + staging_dir = instance.get("stagingDir", None) + if staging_dir and os.path.exists(staging_dir): + self.log.info("Removing temporary folder ...") + os.rmdir(staging_dir)