From 25e7cc4f6c93d6a6fe383b47703b18cc657fdd4f Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 17:17:05 +0100 Subject: [PATCH] loopback --- sh/main.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 2c240b6..4cbf317 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -21,17 +21,21 @@ _sh_ifs_pop() { } sh_source_check() { - local file=".shellcheck.sh" - local module modules - modules="$(sh_source_find "." "${file}")" - rm --force "${file}" + local root="${1}" + local file module modules + file="$(mktemp)" + modules="$(sh_source_find "${root}")" _sh_ifs_new for module in ${modules}; do - echo ". \"${module}\"" >>"${file}" + echo ". \"${root}/${module}\"" >>"${file}" done _sh_ifs_pop shellcheck \ --check-sourced \ + --enable "all" \ + --exclude "3043" \ + --external-sources \ + --shell "dash" \ "${file}" rm "${file}" } @@ -76,7 +80,7 @@ main_source_directory() { _sh_main_log "Not a directory: ${path}" return 1 fi - local cmd count ifs module modules + local cmd count module modules modules="$(sh_source_find "${path}" "${SH_MAIN_NAME}")" _sh_ifs_new count=0 @@ -111,6 +115,7 @@ main_source_file() { _sh_main() { main_source_file "${ENV}" main_source_directory "${SH_USER}" + sh_source_check "$(dirname "${ENV}")" _sh_main_log "" \ "sh_… = shell functions" \ "a__… = aliases" \