main/shell
This commit is contained in:
parent
52a43b0e60
commit
d94880bb75
1 changed files with 27 additions and 19 deletions
46
sh/main.sh
46
sh/main.sh
|
@ -114,25 +114,33 @@ rwx_source() {
|
|||
|
||||
# run initial steps
|
||||
rwx_main() {
|
||||
# system root
|
||||
if ! rwx_source "${RWX_ROOT_SYSTEM}"; then
|
||||
__rwx_log "Not a directory: ${RWX_ROOT_SYSTEM}"
|
||||
return 1
|
||||
fi
|
||||
# user root
|
||||
rwx_source "${RWX_ROOT_USER}"
|
||||
# run interactive extras
|
||||
if rwx_shell_interactive; then
|
||||
# check format
|
||||
rwx_log
|
||||
rwx_shfmt "${RWX_ROOT_SYSTEM}"
|
||||
# check syntax
|
||||
rwx_log
|
||||
rwx_shellcheck "${RWX_ROOT_SYSTEM}"
|
||||
# help
|
||||
rwx_log
|
||||
rwx_self_help
|
||||
fi
|
||||
case "${RWX_SHELL}" in
|
||||
"sh" | \
|
||||
"bash")
|
||||
# system root
|
||||
if ! rwx_source "${RWX_ROOT_SYSTEM}"; then
|
||||
__rwx_log "Not a directory: ${RWX_ROOT_SYSTEM}"
|
||||
return 1
|
||||
fi
|
||||
# user root
|
||||
rwx_source "${RWX_ROOT_USER}"
|
||||
# run interactive extras
|
||||
if rwx_shell_interactive; then
|
||||
# check format
|
||||
rwx_log
|
||||
rwx_shfmt "${RWX_ROOT_SYSTEM}"
|
||||
# check syntax
|
||||
rwx_log
|
||||
rwx_shellcheck "${RWX_ROOT_SYSTEM}"
|
||||
# help
|
||||
rwx_log
|
||||
rwx_self_help
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# run main function
|
||||
|
|
Loading…
Reference in a new issue