Skip to content

Commit

Permalink
Merge pull request #1544 from pyiron/refactor_compress_dir
Browse files Browse the repository at this point in the history
[patch] Refactor compress dir
  • Loading branch information
samwaseda authored Jul 20, 2024
2 parents 7b03591 + 7de65f7 commit 27bc37f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyiron_base/project/archiving/export_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def generate_list_of_directories(df_files, directory_to_transfer, archive_direct

def compress_dir(archive_directory):
arch_comp_name = archive_directory + ".tar.gz"
tar = tarfile.open(arch_comp_name, "w:gz")
tar.add(os.path.relpath(archive_directory, os.getcwd()))
tar.close()
with tarfile.open(arch_comp_name, "w:gz") as tar:
tar.add(os.path.relpath(archive_directory, os.getcwd()))
rmtree(archive_directory)
return arch_comp_name


def copy_files_to_archive(
Expand Down

0 comments on commit 27bc37f

Please sign in to comment.