From: Jakub Czajka Date: Thu, 23 Nov 2023 20:34:31 +0000 (+0100) Subject: Skip copy operation if file already at destination. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=d68d893ccd520787bd03a058a0e916a5276b7986;p=gdrive_knife.git Skip copy operation if file already at destination. --- diff --git a/gdrive_knife.py b/gdrive_knife.py index 24238ae..048986c 100644 --- a/gdrive_knife.py +++ b/gdrive_knife.py @@ -230,8 +230,9 @@ def upload(args): print(f'Archived {args.file} in {path_in_tmp}.') else: os.makedirs(os.path.dirname(path_in_tmp), exist_ok=True) - shutil.copy(args.file, path_in_tmp) - print(f'Copied {args.file} to {path_in_tmp}.') + if args.file != path_in_tmp: + shutil.copy(args.file, path_in_tmp) + print(f'Copied {args.file} to {path_in_tmp}.') encrypt_chunks_in_place(args.key, path_in_tmp) print(f'Encrypted {args.file} in {path_in_tmp}.')