main/commands

This commit is contained in:
Marc Beninca 2024-11-19 14:11:11 +01:00
parent a133acea99
commit c8f6264f20
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -7,7 +7,7 @@ SH_MAIN="${SH_ROOT}/main.sh"
[ -n "${ENV}" ] || export ENV="${SH_MAIN}" [ -n "${ENV}" ] || export ENV="${SH_MAIN}"
main_commands() { _sh_main_commands() {
local file="${1}" local file="${1}"
grep "()" "${file}" | grep "()" "${file}" |
cut --delimiter "(" --fields 1 cut --delimiter "(" --fields 1
@ -35,7 +35,7 @@ main_source_directory() {
module="${path}/${module}" module="${path}/${module}"
if [ "${module}" != "${ENV}" ]; then if [ "${module}" != "${ENV}" ]; then
. "${module}" . "${module}"
cmd="$(main_commands "${module}")" cmd="$(_sh_main_commands "${module}")"
if [ -n "${cmd}" ]; then if [ -n "${cmd}" ]; then
[ -n "${CMD}" ] && CMD="${CMD} [ -n "${CMD}" ] && CMD="${CMD}
" "