From 586373ca3f21e93d86c879ed922d22d235a9ed47 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 18:51:24 +0100 Subject: [PATCH] erroot --- sh/main.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 4925099..e4f45ba 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -64,10 +64,8 @@ _sh_main_commands() { main_source_directory() { local path="${1}" - if [ ! -d "${path}" ]; then - _sh_main_log "Not a directory: ${path}" + [ -d "${path}" ] || return 1 - fi local cmd count module modules modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")" _sh_ifs_new @@ -100,7 +98,10 @@ sh_help() { } sh_main() { - main_source_directory "${SH_ROOT}" + if ! main_source_directory "${SH_ROOT}"; then + _sh_main_log "Not a directory: ${SH_ROOT}" + return 1 + fi main_source_directory "${SH_USER}" sh_log sh_shellcheck "${SH_ROOT}"