Kaydet (Commit) 257fb114 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

updater: replace whitespace in dir names and strip the extra win dir layer

Change-Id: I543b903157d44038468eb4d92261dfd0d8b2909b
üst 5daa3a1c
......@@ -20,7 +20,12 @@ def uncompress_file_to_dir(compressed_file, uncompress_dir):
zip_file = zipfile.ZipFile(compressed_file)
zip_file.extractall(uncompress_dir)
zip_file.close()
pass
uncompress_dir = os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0])
if " " in os.listdir(uncompress_dir)[0]:
print("replacing whitespace in directory name")
os.rename(os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0]),
os.path.join(uncompress_dir, os.listdir(uncompress_dir)[0].replace(" ", "_")))
else:
print("Error: unknown extension " + extension)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment