MCPcopy Index your code
hub / github.com/nodejs/node / unpack

Function unpack

tools/configure.d/nodedownload.py:66–80  ·  view source on GitHub ↗

Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path

(packedfile, parent_path)

Source from the content-addressed store, hash-verified

64 return digest.hexdigest()
65
66def unpack(packedfile, parent_path):
67 """Unpacks packedfile into parent_path. Assumes .zip. Returns parent_path"""
68 if zipfile.is_zipfile(packedfile):
69 with contextlib.closing(zipfile.ZipFile(packedfile, 'r')) as icuzip:
70 print(' Extracting zipfile: %s' % packedfile)
71 icuzip.extractall(parent_path)
72 return parent_path
73 elif tarfile.is_tarfile(packedfile):
74 with contextlib.closing(tarfile.TarFile.open(packedfile, 'r')) as icuzip:
75 print(' Extracting tarfile: %s' % packedfile)
76 icuzip.extractall(parent_path)
77 return parent_path
78 else:
79 packedsuffix = packedfile.lower().split('.')[-1] # .zip, .tgz etc
80 raise Exception('Error: Don\'t know how to unpack %s with extension %s' % (packedfile, packedsuffix))
81
82# List of possible "--download=" types.
83download_types = set(['icu'])

Callers

nothing calls this directly

Calls 4

openMethod · 0.65
printFunction · 0.50
closingMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…