Skip to content

Commit 56e5c2e

Browse files
authored
Merge pull request #79 from griptape-ai/fix/update_publish
fix: use copy+delete instead of rename when publishing over existing workflow version
2 parents 12c454c + d067bfa commit 56e5c2e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

publish_gizmo/nuke_gizmo_publisher.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,14 @@ def publish_workflow(self) -> ResultPayload:
9797
# so outputs land next to the .nk file, not inside the companion bundle.
9898
self._customize_project_yml(companion_base)
9999

100-
# Move the workflow file from companion base into the version subdir
100+
# Move the workflow file from companion base into the version subdir.
101+
# Use copy+delete instead of rename so re-publishing over an existing
102+
# version (where dest already exists) succeeds without error.
101103
src_workflow = companion_base / workflow_file_path.name
102104
dest_workflow = version_dir / workflow_file_path.name
103105
if src_workflow.exists():
104-
self._move_file(src_workflow, dest_workflow)
106+
self._copy_file(src_workflow, dest_workflow, overwrite=True)
107+
src_workflow.unlink()
105108

106109
# Copy the runner and button scripts (shared, overwrite on each publish)
107110
self._packager.emit_progress(5.0, "Writing runner script...")

0 commit comments

Comments
 (0)