We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dce0dda commit 7cf7c06Copy full SHA for 7cf7c06
xklb/scripts/merge_folders.py
@@ -100,16 +100,16 @@ def print_mv(t):
100
printing.pipe_print("mv", t[1], t[2])
101
102
def mv(t):
103
+ mv_fn = os.renames
104
if t[0]: ## file exists in destination already
105
+ mv_fn = os.replace
106
if not clobber:
107
log.info("[%s]: Skipping due to existing file %s", t[1], t[2])
- else:
- os.replace(t[1], t[2])
108
- else: ## file does not exist in destination already
109
- try:
110
- os.renames(t[1], t[2])
111
- except Exception:
112
- file_utils.rename_move_file(t[1], t[2])
+ return
+ try:
+ mv_fn(t[1], t[2])
+ except Exception:
+ file_utils.rename_move_file(t[1], t[2])
113
114
if args.simulate:
115
for p in empty_folder_data:
0 commit comments