Compare commits

..

No commits in common. "13ab4b8ec7700a2421fa21ed8d8b948e0acbecc2" and "7a8915682d3333a6a04215669346ae87bd9d355c" have entirely different histories.

4 changed files with 13 additions and 56 deletions

View file

@ -6,10 +6,8 @@
# │ code │ variables │
# ╰──────┴───────────╯
# main modules names
rwx_code_modules_main=""
# user modules names
rwx_code_modules_user=""
# path to the entrypoint main file of the project
rwx_code_main="${rwx_main_root}/${RWX_MAIN_MODULE}.${RWX_MAIN_EXTENSION}"
# user root directory of the project
rwx_code_root="${HOME}/${RWX_MAIN_NAME}"
@ -65,7 +63,7 @@ rwx_code_install() {
name="${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}"
file="${root}/${name}"
rwx_remove "${file}"
rwx_link "${file}" "${rwx_main_path}"
rwx_link "${file}" "${rwx_code_main}"
while IFS= read -r command; do
file="${root}/${command}"
rwx_remove "${file}"
@ -77,12 +75,12 @@ EOF
file="${target}/etc/profile.d/${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}"
rwx_remove "${file}"
rwx_file_write "${file}" "\
export ENV=\"${rwx_main_path}\"
export ENV=\"${rwx_code_main}\"
"
# bash
file="${target}/etc/bash.bashrc"
rwx_remove "${file}"
rwx_link "${file}" "${rwx_main_path}"
rwx_link "${file}" "${rwx_code_main}"
}
# ╭──────┬───────╮
@ -151,25 +149,6 @@ 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() {
@ -246,16 +225,14 @@ rwx_code_parse() {
rwx_code_main() {
local modules_main="${1}"
local module
rwx_code_modules_main="${modules_main}"
# find user modules
rwx_code_modules_user="$(rwx_main_find "${rwx_code_root}")"
# source user modules
local module modules_user
# find & source modules
modules_user="$(rwx_main_find "${rwx_code_root}")"
while IFS= read -r module; do
# shellcheck disable=SC1090
. "${rwx_code_root}/${module}.${RWX_MAIN_EXTENSION}"
done <<EOF
${rwx_code_modules_user}
${modules_user}
EOF
# cache main modules
while IFS= read -r module; do
@ -266,14 +243,14 @@ $(cat "${rwx_main_root}/${module}.${RWX_MAIN_EXTENSION}")
done <<EOF
${modules_main}
EOF
# cache user modules
# cache modules
while IFS= read -r module; do
# cache user module
# cache module
_rwx_code="${_rwx_code}#. ${module}
$(cat "${rwx_code_root}/${module}.${RWX_MAIN_EXTENSION}")
"
done <<EOF
${rwx_code_modules_user}
${modules_user}
EOF
# load code cache
rwx_code_load

View file

@ -22,11 +22,6 @@ 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 │

View file

@ -55,7 +55,7 @@ rwx_shell_interactive() {
}
rwx_shell_configure() {
[ -n "${ENV}" ] || ENV="${rwx_main_path}"
[ -n "${ENV}" ] || ENV="${rwx_code_main}"
export ENV
# prompt
PS1="\$(rwx_shell_prompt \${?})"

View file

@ -29,18 +29,3 @@ esac
.....() {
cd ../../../..
}
# shellcheck disable=SC3033
......() {
cd ../../../../..
}
# shellcheck disable=SC3033
.......() {
cd ../../../../../..
}
# shellcheck disable=SC3033
........() {
cd ../../../../../../..
}