From 7fcb01ffa2ef72d592b672c2d367c34449c29f53 Mon Sep 17 00:00:00 2001 From: Ryan Reed Date: Fri, 8 Sep 2023 19:30:01 -0400 Subject: [PATCH] Fix: Generate store name from path when not provided --- src/transpose/console.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/transpose/console.py b/src/transpose/console.py index 20259c9..9a38f1d 100644 --- a/src/transpose/console.py +++ b/src/transpose/console.py @@ -1,5 +1,7 @@ import argparse +from pathlib import Path + from transpose import Transpose, version, DEFAULT_STORE_PATH from .exceptions import TransposeError @@ -22,6 +24,9 @@ def run(args, config_path) -> None: elif args.action == "restore": t.restore(args.name, force=args.force) elif args.action == "store": + if not args.name: + target_path = Path(args.target_path) + args.name = str(target_path.parts[-1]) t.store(args.name, args.target_path) elif args.action == "config": if args.config_action == "add":