Skip to content

Commit cc7bb37

Browse files
committed
Fix newly introduced error when installing Luarocks on win
Archive names contain dots, don't remove too much when stripping extensions.
1 parent 095dcc9 commit cc7bb37

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hererocks.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,12 @@ def sha256_of_file(filename):
419419
return hashlib.sha256(contents).hexdigest()
420420

421421
def strip_extensions(filename):
422-
# Just handle .zip and .tar.gz.
423-
return os.path.splitext(os.path.splitext(filename)[0])[0]
422+
if filename.endswith(".zip"):
423+
return filename[:-len(".zip")]
424+
elif filename.endswith(".tar.gz"):
425+
return filename[:-len(".tar.gz")]
426+
else:
427+
return filename
424428

425429
class Program(object):
426430
def __init__(self, version):

0 commit comments

Comments
 (0)