This commit is contained in:
Marc Beninca 2024-11-20 16:47:41 +01:00
parent d691f67581
commit ee694a8fde
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -15,6 +15,18 @@ _sh_main_commands() {
cut --delimiter "(" --fields 1 cut --delimiter "(" --fields 1
} }
_sh_main_log() {
case "${-}" in
*i*)
local argument
for argument in "${@}"; do
echo "${argument}"
done
;;
*) ;;
esac
}
main_source_directory() { main_source_directory() {
local path="${1}" local path="${1}"
if [ -d "${path}" ]; then if [ -d "${path}" ]; then
@ -28,12 +40,12 @@ main_source_directory() {
IFS=" IFS="
" "
count=0 count=0
#echo _sh_main_log "" \
#echo ". ${path}" ". ${path}"
for module in ${modules}; do for module in ${modules}; do
count=$((count + 1)) count=$((count + 1))
#printf "%02d" "${count}" #printf "%02d" "${count}"
#echo " ${module%.sh}" _sh_main_log "${module%.sh}"
module="${path}/${module}" module="${path}/${module}"
if [ "${module}" != "${ENV}" ]; then if [ "${module}" != "${ENV}" ]; then
. "${module}" . "${module}"
@ -47,7 +59,7 @@ main_source_directory() {
done done
IFS="${ifs}" IFS="${ifs}"
else else
#echo "Not a directory: ${path}" _sh_main_log "Not a directory: ${path}"
return 1 return 1
fi fi
} }
@ -57,7 +69,7 @@ main_source_file() {
if [ -f "${path}" ]; then if [ -f "${path}" ]; then
main_source_directory "$(dirname "${path}")" main_source_directory "$(dirname "${path}")"
else else
#echo "Not a file: ${path}" _sh_main_log "Not a file: ${path}"
return 1 return 1
fi fi
} }
@ -66,7 +78,7 @@ main_source_file "${ENV}"
main_source_directory "${SH_USER}" main_source_directory "${SH_USER}"
#sh_log "" \ _sh_main_log "" \
# "sh_… = shell functions" \ "sh_… = shell functions" \
# "a__… = aliases" \ "a__… = aliases" \
# "u__… = user" "u__… = user"