]> git.ekhem.eu.org Git - gdrive_knife.git/commitdiff
Rename the file after moving to final destination.
authorJakub Czajka <jakub@ekhem.eu.org>
Sun, 5 Nov 2023 21:22:24 +0000 (22:22 +0100)
committerJakub Czajka <jakub@ekhem.eu.org>
Sun, 19 Nov 2023 13:58:52 +0000 (14:58 +0100)
gdrive_knife.py

index c64fdfbb272088a05795dc988f2777ca35b642d7..81e3076a7cc7d377244387be74742288445279fc 100644 (file)
@@ -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)