Skip to content

Commit

Permalink
fix(get.py): Fix parent folder name
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz committed Jun 2, 2024
1 parent 5f57cd3 commit 95ad38d
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 95ad38d

Please sign in to comment.