From: Cheng Zhao Date: Fri, 21 Jun 2013 02:32:57 +0000 (+0800) Subject: Use unzip command on Mac to keep symbol links in zip file work. X-Git-Tag: v0.1.0~84^2~9 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=1eb521d32a842dc2a7421043419bf95d9e9aae81;p=electron.git Use unzip command on Mac to keep symbol links in zip file work. --- diff --git a/script/lib/util.py b/script/lib/util.py index f4f42be9..ab331870 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -3,6 +3,8 @@ import atexit import errno import shutil +import subprocess +import sys import tarfile import tempfile import urllib2 @@ -44,8 +46,12 @@ def extract_tarball(tarball_path, member, destination): def extract_zip(zip_path, destination): - with zipfile.ZipFile(zip_path) as z: - z.extractall(destination) + if sys.platform == 'darwin': + # Use unzip command on Mac to keep symbol links in zip file work. + subprocess.check_call(['unzip', zip_path, '-d', destination]) + else: + with zipfile.ZipFile(zip_path) as z: + z.extractall(destination) def safe_unlink(path):