From: Jakub Czajka Date: Sun, 5 Nov 2023 21:22:24 +0000 (+0100) Subject: Rename the file after moving to final destination. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=2d7d73bcf95f3c8c926a1dc836b9d23bcb117e22;p=gdrive_knife.git Rename the file after moving to final destination. --- 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)