From 81e915f30c861434d6cdc2983ea2359e5896a4bd Mon Sep 17 00:00:00 2001 From: Hans Fangohr <fangohr@users.noreply.github.com> Date: Sun, 2 Jul 2023 07:49:27 +0200 Subject: [PATCH] use `error` to report the problem: gives clearer message due to color Remove printing of current working directory to debug message: usually the user will know in which directory they are, so this information detracts from the interesting content of the error message. --- src/mpsd_software_manager/mpsd_software.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mpsd_software_manager/mpsd_software.py b/src/mpsd_software_manager/mpsd_software.py index d7d05ec..d4c0223 100755 --- a/src/mpsd_software_manager/mpsd_software.py +++ b/src/mpsd_software_manager/mpsd_software.py @@ -1153,10 +1153,11 @@ def get_root_dir() -> Path: return script_call_dir # if not found in any parent directory, exit with an error message - logging.getLogger("print").info( + logging.debug(f"Directory {str(script_call_dir)} is not a MPSD software instance.") + + logging.error( "Error: Could not find MPSD software instance " "in the current directory or any parent directory.\n" - f"Directory {str(script_call_dir)} is not a MPSD software instance.\n" "Please run 'mpsd-software init' to " "initialise the software instance here, " "or switch to a directory which is already initialised.\n \n" -- GitLab