Skip to content

Commit

Permalink
Fix permission denied errors on run-crate tarball extraction
Browse files Browse the repository at this point in the history
The CrateDB tarball contains files without write permission, so
extracting to the same location twice can lead to permission denied
errors.
  • Loading branch information
mfussenegger committed Mar 20, 2024
1 parent e4215fd commit 79c23b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cr8/run_crate.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,9 @@ def _extract_tarball(tarball):
# Normalize to folder
folder_name = os.path.dirname(first_file)
folder_name = folder_name == "" and first_file or folder_name
target = tarball.parent / folder_name
if target.exists():
shutil.rmtree(target)
t.extractall(tarball.parent)
return str(tarball.parent / folder_name)

Expand Down

0 comments on commit 79c23b2

Please sign in to comment.