From de82ed02dc000b8f70662136506ebeac6a4745a4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 9 Jul 2025 23:37:36 +0200 Subject: [PATCH 1/4] bash/... --- sh/shell/bash.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sh/shell/bash.sh b/sh/shell/bash.sh index 2f5d2d8..30584fa 100644 --- a/sh/shell/bash.sh +++ b/sh/shell/bash.sh @@ -29,3 +29,18 @@ esac .....() { cd ../../../.. } + +# shellcheck disable=SC3033 +......() { + cd ../../../../.. +} + +# shellcheck disable=SC3033 +.......() { + cd ../../../../../.. +} + +# shellcheck disable=SC3033 +........() { + cd ../../../../../../.. +} From af31b433accbfeeb8e68a27b42a0b86ec7a3f990 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 10 Jul 2025 00:20:49 +0200 Subject: [PATCH 2/4] code/comments --- sh/core/code.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sh/core/code.sh b/sh/core/code.sh index f8748c0..cb4bf61 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -225,9 +225,11 @@ rwx_code_parse() { rwx_code_main() { local modules_main="${1}" - local module modules_user - # find & source modules + local module + local modules_user + # find user modules modules_user="$(rwx_main_find "${rwx_code_root}")" + # source user modules while IFS= read -r module; do # shellcheck disable=SC1090 . "${rwx_code_root}/${module}.${RWX_MAIN_EXTENSION}" From bfcfde352095eae26062fbdfe45b5e8f0f326eb9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Thu, 10 Jul 2025 00:44:32 +0200 Subject: [PATCH 3/4] modules/name,user --- sh/core/code.sh | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/sh/core/code.sh b/sh/core/code.sh index cb4bf61..47586d1 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -8,6 +8,10 @@ # path to the entrypoint main file of the project rwx_code_main="${rwx_main_root}/${RWX_MAIN_MODULE}.${RWX_MAIN_EXTENSION}" +# main modules names +rwx_code_modules_main="" +# user modules names +rwx_code_modules_user="" # user root directory of the project rwx_code_root="${HOME}/${RWX_MAIN_NAME}" @@ -149,6 +153,25 @@ rwx_code_functions() { echo "${_rwx_code_functions}" } +# show all the cached main modules +#= rcm +rwx_code_modules() { + rwx_code_modules_main + rwx_code_modules_user +} + +# show the cached main modules +#= rcmm +rwx_code_modules_main() { + echo "${rwx_code_modules_main}" +} + +# show the cached user modules +#= rcmu +rwx_code_modules_user() { + echo "${rwx_code_modules_user}" +} + # show the cached variables #= rcv rwx_code_variables() { @@ -226,15 +249,15 @@ rwx_code_parse() { rwx_code_main() { local modules_main="${1}" local module - local modules_user + rwx_code_modules_main="${modules_main}" # find user modules - modules_user="$(rwx_main_find "${rwx_code_root}")" + rwx_code_modules_user="$(rwx_main_find "${rwx_code_root}")" # source user modules while IFS= read -r module; do # shellcheck disable=SC1090 . "${rwx_code_root}/${module}.${RWX_MAIN_EXTENSION}" done < Date: Thu, 10 Jul 2025 01:49:19 +0200 Subject: [PATCH 4/4] main/file,path --- sh/core/code.sh | 8 +++----- sh/main.sh | 5 +++++ sh/shell/0.sh | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sh/core/code.sh b/sh/core/code.sh index 47586d1..0d308f3 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -6,8 +6,6 @@ # │ code │ variables │ # ╰──────┴───────────╯ -# path to the entrypoint main file of the project -rwx_code_main="${rwx_main_root}/${RWX_MAIN_MODULE}.${RWX_MAIN_EXTENSION}" # main modules names rwx_code_modules_main="" # user modules names @@ -67,7 +65,7 @@ rwx_code_install() { name="${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}" file="${root}/${name}" rwx_remove "${file}" - rwx_link "${file}" "${rwx_code_main}" + rwx_link "${file}" "${rwx_main_path}" while IFS= read -r command; do file="${root}/${command}" rwx_remove "${file}" @@ -79,12 +77,12 @@ EOF file="${target}/etc/profile.d/${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}" rwx_remove "${file}" rwx_file_write "${file}" "\ -export ENV=\"${rwx_code_main}\" +export ENV=\"${rwx_main_path}\" " # bash file="${target}/etc/bash.bashrc" rwx_remove "${file}" - rwx_link "${file}" "${rwx_code_main}" + rwx_link "${file}" "${rwx_main_path}" } # ╭──────┬───────╮ diff --git a/sh/main.sh b/sh/main.sh index 2039ba5..09d3cd0 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -22,6 +22,11 @@ RWX_MAIN_EXTENSION="sh" # project main root directory rwx_main_root="${RWX_MAIN_PARENT}/${RWX_MAIN_NAME}" +# project main entrypoint file +rwx_main_file="${RWX_MAIN_MODULE}/${RWX_MAIN_EXTENSION}" + +# path to the entrypoint main file of the project +rwx_main_path="${rwx_main_root}/${rwx_main_file}" # ╭──────┬──────╮ # │ main │ find │ diff --git a/sh/shell/0.sh b/sh/shell/0.sh index f93f312..415d371 100644 --- a/sh/shell/0.sh +++ b/sh/shell/0.sh @@ -55,7 +55,7 @@ rwx_shell_interactive() { } rwx_shell_configure() { - [ -n "${ENV}" ] || ENV="${rwx_code_main}" + [ -n "${ENV}" ] || ENV="${rwx_main_path}" export ENV # prompt PS1="\$(rwx_shell_prompt \${?})"