Commit 0d63861b authored by Robert Schmidt's avatar Robert Schmidt

cls_cmd.py: local copy: don't copy if src/tgt identical

parent f21b5d2e
......@@ -129,6 +129,8 @@ class LocalCmd(Cmd):
def copyin(self, src, tgt, recursive=False):
if src[0] != '/' or tgt[0] != '/':
raise Exception(f'support only absolute file paths (src {src} tgt {tgt})!')
if src == tgt:
return # nothing to copy, file is already where it should go
opt = '-r' if recursive else ''
return self.run(f'cp {opt} {src} {tgt}').returncode == 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment