MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / copytree

Function copytree

utils/install.py:211–229  ·  view source on GitHub ↗
(src, dst, symlinks=True, ignore=None)

Source from the content-addressed store, hash-verified

209# how-do-i-copy-an-entire-directory-of-files-
210# into-an-existing-directory-using-pyth
211def copytree(src, dst, symlinks=True, ignore=None):
212 if not exists(dst):
213 makedirs(dst)
214 shutil.copystat(src, dst)
215 lst = listdir(src)
216 if ignore:
217 excl = ignore(src, lst)
218 lst = [x for x in lst if x not in excl]
219 for item in lst:
220 s = join(src, item)
221 d = join(dst, item)
222 if symlinks and islink(s):
223 if lexists(d):
224 remove(d)
225 symlink(readlink(s), d)
226 elif isdir(s):
227 copytree(s, d, symlinks, ignore)
228 else:
229 shutil.copy2(s, d)
230
231
232class VersionString:

Callers 3

install_pluginsFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected