Skip to content

feat(tools): Updated get.py with ability to verify extracted files and skip if ok #8720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(get.py): Fix parent folder name
  • Loading branch information
lucasssvaz committed Jun 2, 2024
commit 95ad38d9a4a097bc3a7c121fd768406ed61efbf2
6 changes: 3 additions & 3 deletions tools/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,21 +164,21 @@ def unpack(filename, destination, force_extract): # noqa: C901
if filename.endswith("tar.gz"):
if tarfile.is_tarfile(filename):
cfile = tarfile.open(filename, "r:gz")
dirname = cfile.getnames()[0]
dirname = cfile.getnames()[0].split("/")[0]
else:
print("File corrupted!")
file_is_corrupted = True
elif filename.endswith("tar.xz"):
if tarfile.is_tarfile(filename):
cfile = tarfile.open(filename, "r:xz")
dirname = cfile.getnames()[0]
dirname = cfile.getnames()[0].split("/")[0]
else:
print("File corrupted!")
file_is_corrupted = True
elif filename.endswith("zip"):
if zipfile.is_zipfile(filename):
cfile = zipfile.ZipFile(filename)
dirname = cfile.namelist()[0]
dirname = cfile.namelist()[0].split("/")[0]
else:
print("File corrupted!")
file_is_corrupted = True
Expand Down