Create zip distribution for binaries on Windows.

This commit is contained in:
Cheng Zhao 2013-08-31 09:37:02 +08:00
parent 24f510ca03
commit beba27ed1e
2 changed files with 14 additions and 3 deletions

View file

@ -64,6 +64,16 @@ def extract_zip(zip_path, destination):
with zipfile.ZipFile(zip_path) as z:
z.extractall(destination)
def make_zip(zip_file_path, files):
safe_unlink(zip_file_path)
if sys.platform == 'darwin':
subprocess.check_call(['zip', '-r', '-y', zip_file_path] + files)
else:
zip_file = zipfile.ZipFile(zip_file_path, "w")
for filename in files:
zip_file.write(filename, filename)
zip_file.close()
def rm_rf(path):
try: