Skip to content

Commit

Permalink
Clean the working directory attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
liamhuber committed Jan 16, 2024
1 parent bd62c77 commit 10db67c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyiron_workflow/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def __post__(
if save_exists and overwrite_save:
self.working_directory.remove_files(hardcoded_tinybase_filename)

self.working_directory.delete(only_if_empty=True)
self._working_directory = self.working_directory.delete(only_if_empty=True)
# Touching the working directory may have created it -- if it's there and empty
# just clean it up

Expand Down
2 changes: 2 additions & 0 deletions pyiron_workflow/snippets/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def create(self):
def delete(self, only_if_empty: bool = False):
if self.is_empty() or not only_if_empty:
delete_files_and_directories_recursively(self.path)
else:
return self

def list_content(self):
return categorize_folder_items(self.path)
Expand Down

0 comments on commit 10db67c

Please sign in to comment.