Copies a directory from source to target.
(source, target, allow_overwrite=False)
| 228 | |
| 229 | |
| 230 | def move_directory(source, target, allow_overwrite=False): |
| 231 | """ Copies a directory from source to target. """ |
| 232 | if not options.dryrun and os.path.exists(target): |
| 233 | if not allow_overwrite: |
| 234 | raise Exception("Directory %s already exists" % (target)) |
| 235 | remove_directory(target) |
| 236 | if os.path.exists(source): |
| 237 | msg("Moving directory %s to %s" % (source, target)) |
| 238 | if not options.dryrun: |
| 239 | shutil.move(source, target) |
| 240 | |
| 241 | |
| 242 | def is_git_checkout(path): |
no test coverage detected