From de22cafbd0c3d630235f7987ad59093b8416be7a Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 29 Nov 2024 19:41:07 +0100 Subject: [PATCH] main --- sh/main.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 694b38b..b2dd223 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -2,19 +2,19 @@ # │ constants │ # ╰───────────╯ -SH_MAIN_NAME="main.sh" -SH_NAME="sh" +RWX_MAIN_FILE_NAME="main.sh" +RWX_NAME="sh" -SH_ROOT="/etc/${SH_NAME}" +RWX_ROOT_SYSTEM="/etc/${RWX_NAME}" -SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}" +RWX_MAIN="${RWX_ROOT_SYSTEM}/${RWX_MAIN_FILE_NAME}" # ╭───────────╮ # │ variables │ # ╰───────────╯ -SH_SHELL="$(cat "/proc/${$}/comm")" -SH_USER="${HOME}/${SH_NAME}" +RWX_SHELL="$(cat "/proc/${$}/comm")" +RWX_ROOT_USER="${HOME}/${RWX_NAME}" # ╭──────────╮ # │ internal │ @@ -102,7 +102,7 @@ rwx_main_source() { [ -d "${path}" ] || return 1 local cmd count module modules - modules="$(rwx_find_sh "${path}" "${SH_MAIN_NAME}")" + modules="$(rwx_find_sh "${path}" "${RWX_MAIN_FILE_NAME}")" rwx_ifs_set count=0 _rwx_main_log "" \ @@ -130,20 +130,20 @@ rwx_main_source() { # run initial steps rwx_main() { # system root - if ! rwx_main_source "${SH_ROOT}"; then - _rwx_main_log "Not a directory: ${SH_ROOT}" + if ! rwx_main_source "${RWX_ROOT_SYSTEM}"; then + _rwx_main_log "Not a directory: ${RWX_ROOT_SYSTEM}" return 1 fi # user root - rwx_main_source "${SH_USER}" + rwx_main_source "${RWX_ROOT_USER}" # run interactive extras if rwx_shell_interactive; then # check format rwx_log - rwx_shfmt_check "${SH_ROOT}" + rwx_shfmt_check "${RWX_ROOT_SYSTEM}" # check syntax rwx_log - rwx_shellcheck_check "${SH_ROOT}" + rwx_shellcheck_check "${RWX_ROOT_SYSTEM}" # help rwx_log rwx_help