diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py index 0803f7b623f1d8aa37a775c115da697f63aa9750..463d2c92b056487877a7aa39b536dde4dbd2f0f0 100755 --- a/src/mpsd_software_manager/mpsd_software.py +++ b/src/mpsd_software_manager/mpsd_software.py @@ -1261,6 +1261,11 @@ def main(): initialise_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() @@ -1275,14 +1280,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 34c98668b56d1842ecd5d4ee0fff3c88cf7c99d3..88dcb23fd20f687cac15bd3936c744343ed517fb 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)