[K/N][publish] Fix getting the extracted dir name

Python's rstrip() method with argument removes not the string
but all combinations of specified chars
This commit is contained in:
Pavel Punegov
2022-04-29 15:39:36 +03:00
committed by Space
parent c1f2d66ed8
commit d5b450c8fa
@@ -24,7 +24,7 @@ for bundle in bundles:
unpackCommand = 'unzip -qq' if bundle.endswith('.zip') else 'tar -xzf'
os.system(unpackCommand + ' ' + bundle)
extractedDir = bundle.rstrip('.tar.gz').rstrip('.zip')
extractedDir = bundle.replace('.tar.gz', '').replace('.zip', '')
renamedDir = extractedDir.replace('-prebuilt-', '-')
print('Renaming ' + extractedDir + ' to ' + renamedDir)
os.rename(extractedDir, renamedDir)