MCPcopy Create free account
hub / github.com/defold/defold / ziptree

Function ziptree

editor/scripts/bundle.py:171–184  ·  view source on GitHub ↗
(path, outfile, directory = None)

Source from the content-addressed store, hash-verified

169 return path
170
171def ziptree(path, outfile, directory = None):
172 # Directory is similar to -C in tar
173
174 zip = zipfile.ZipFile(outfile, 'w')
175 for root, dirs, files in os.walk(path):
176 for f in files:
177 p = os.path.join(root, f)
178 an = p
179 if directory:
180 an = os.path.relpath(p, directory)
181 zip.write(p, an)
182
183 zip.close()
184 return outfile
185
186def gz_tree(path, outfile, directory=None):
187 # compress files and folders in path to outfile using tar:gz compression

Callers 1

create_bundleFunction · 0.85

Calls 3

walkMethod · 0.65
closeMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected