diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py index 0c17450fd721a7031af5bb92564c9a17c2c5d178..50dea3fb51379cf1f3f7eb6e1ca963f3d9e3bb9c 100755 --- a/src/mpsd_software_manager/mpsd_software.py +++ b/src/mpsd_software_manager/mpsd_software.py @@ -1260,6 +1260,11 @@ def main(): initialize_environment(Path(os.getcwd())) sys.exit(0) + # sanity check for common mistakes in command line arguments + if args.release.endswith("/"): # happens easily with autocompletion + args.release = args.release.removesuffix("/") + logging.warning(f"Removed trailing slash from release: {args.release}") + # root_dir is the place where this MPSD software instance has its root root_dir = get_root_dir() @@ -1274,14 +1279,6 @@ def main(): log_file, ) - # sanity check for common mistakes in command line arguments - if args.release.endswith("/"): # happens easily with autocompletion - logging.error( - f"You provided mpsd-release='{args.release}'. " - f"Did you mean '{args.release.removesuffix('/')}'?" - ) - sys.exit(1) - # Check the command and run related function if args.action == "remove": remove_environment(args.release, root_dir, args.package_set) diff --git a/tests/test_mpsd_software.py b/tests/test_mpsd_software.py index 79fc35cea3ee48a3f7f625abd3495bd607bcf51c..01eca5373801cbe034b092786b93f06f505c8481 100644 --- a/tests/test_mpsd_software.py +++ b/tests/test_mpsd_software.py @@ -575,6 +575,7 @@ def test_interface(tmp_path): # check that the help message is printed when no arguments are provided # check that the help message is printed when -h is provided # check that the error messages are also logged to the log file + # check that `/` in release is handled correctly # other tests to add (ideally)