From 2d7d73bcf95f3c8c926a1dc836b9d23bcb117e22 Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Sun, 5 Nov 2023 22:22:24 +0100 Subject: [PATCH] Rename the file after moving to final destination. --- gdrive_knife.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gdrive_knife.py b/gdrive_knife.py index c64fdfb..81e3076 100644 --- a/gdrive_knife.py +++ b/gdrive_knife.py @@ -142,8 +142,9 @@ def download(args): shutil.unpack_archive(path_in_tmp, extract_dir=args.output, format='zip') print(f'Unarchived to {args.output}.') else: - shutil.move(path_in_tmp, args.output) - print(f'Moved to {args.output}.') + destination = args.output + '/' + os.path.basename(args.path) + shutil.move(path_in_tmp, destination) + print(f'Moved to {destination}.') def upload(args): drive = get_drive_client(args.token) -- 2.39.5