Skip to content

Commit 2e3d3bf

Browse files
committed
clear out old before new extraction
1 parent 01a8064 commit 2e3d3bf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

release.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import shutil
23
import requests
34
import zipfile
45

@@ -17,6 +18,9 @@
1718
f.write(chunk)
1819

1920
z = zipfile.ZipFile("web.zip")
20-
z.extractall(os.path.join(BASE_DIR, "requestbin", "web"))
21+
path = os.path.join(BASE_DIR, "requestbin", "web")
22+
if os.path.exists(path) and os.path.isdir(path):
23+
shutil.rmtree(path)
24+
z.extractall(path)
2125

2226
os.remove("web.zip")

0 commit comments

Comments
 (0)