Copy files like shutil.copy, but src may be a glob pattern.
(context, src, dest, destPrefix = '')
| 300 | os.symlink(linkTo, symlink) |
| 301 | |
| 302 | def CopyFiles(context, src, dest, destPrefix = ''): |
| 303 | """ |
| 304 | Copy files like shutil.copy, but src may be a glob pattern. |
| 305 | """ |
| 306 | filesToCopy = glob.glob(src) |
| 307 | if not filesToCopy: |
| 308 | raise RuntimeError("File(s) to copy {src} not found".format(src=src)) |
| 309 | |
| 310 | instDestDir = os.path.join(context.externalsInstDir, destPrefix, dest) |
| 311 | if not os.path.isdir(instDestDir): |
| 312 | os.makedirs(instDestDir) |
| 313 | |
| 314 | for f in filesToCopy: |
| 315 | PrintCommandOutput("Copying {file} to {destDir}\n" |
| 316 | .format(file=f, destDir=instDestDir)) |
| 317 | shutil.copy(f, instDestDir) |
| 318 | |
| 319 | def CopyDirectory(context, srcDir, destDir, destPrefix = ''): |
| 320 | """ |
no test coverage detected