From edbf89813655f70bcae04458c9675b2286963c25 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Sun, 17 Mar 2024 14:00:27 -0400 Subject: [PATCH] [UPD] script check addons exist: show different error when multiple module - this permit to know if multiple same module or missing module - ignore warning when ask for module path --- script/addons/check_addons_exist.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/script/addons/check_addons_exist.py b/script/addons/check_addons_exist.py index 8ba791b..6de0543 100755 --- a/script/addons/check_addons_exist.py +++ b/script/addons/check_addons_exist.py @@ -22,6 +22,7 @@ def get_config(): formatter_class=argparse.RawDescriptionHelpFormatter, description="""\ Check if module exist and is not multiple here to manage conflict. + Return 0 if success, return 1 if missing module, return 2 if multiple same module """, epilog="""\ """, @@ -93,8 +94,10 @@ def main(): lst_module_not_exist.append(module) is_good = True + error_missing_module = False if lst_module_not_exist: is_good = False + error_missing_module = True module_list = "'" + "', '".join(lst_module_not_exist) + "'" _logger.error( "Missing" @@ -114,7 +117,7 @@ def main(): for value in lst_value: print(value) - if dct_module_exist_empty: + if dct_module_exist_empty and not config.output_path: for key, lst_value in dct_module_exist_empty.items(): module_list = "'" + "', '".join(lst_value) + "'" _logger.warning( @@ -122,7 +125,11 @@ def main(): f" {module_list}" ) - return 0 if is_good else -1 + if not is_good: + if error_missing_module: + return 1 + return 2 + return 0 if __name__ == "__main__":