mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
let the download script remove the extraction folder in case it exists
This commit is contained in:
parent
689be6529d
commit
6ec984bbd5
|
@ -8,6 +8,12 @@ def unzip(filename, where):
|
||||||
z = zipfile.ZipFile(filename, "r")
|
z = zipfile.ZipFile(filename, "r")
|
||||||
except:
|
except:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# remove extraction folder, if it exists
|
||||||
|
if os.path.exists(z.namelist()[0]):
|
||||||
|
shutil.rmtree(z.namelist()[0])
|
||||||
|
|
||||||
|
# extract files
|
||||||
for name in z.namelist():
|
for name in z.namelist():
|
||||||
z.extract(name, where)
|
z.extract(name, where)
|
||||||
z.close()
|
z.close()
|
||||||
|
|
Loading…
Reference in a new issue