Use unzip command on Mac to keep symbol links in zip file work.
This commit is contained in:
parent
2f50102b50
commit
1eb521d32a
1 changed files with 8 additions and 2 deletions
|
@ -3,6 +3,8 @@
|
||||||
import atexit
|
import atexit
|
||||||
import errno
|
import errno
|
||||||
import shutil
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
import tarfile
|
import tarfile
|
||||||
import tempfile
|
import tempfile
|
||||||
import urllib2
|
import urllib2
|
||||||
|
@ -44,8 +46,12 @@ def extract_tarball(tarball_path, member, destination):
|
||||||
|
|
||||||
|
|
||||||
def extract_zip(zip_path, destination):
|
def extract_zip(zip_path, destination):
|
||||||
with zipfile.ZipFile(zip_path) as z:
|
if sys.platform == 'darwin':
|
||||||
z.extractall(destination)
|
# 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):
|
def safe_unlink(path):
|
||||||
|
|
Loading…
Reference in a new issue