# ╭──────╮ # │ code │ # ╰──────╯ # ╭──────┬───────────╮ # │ code │ variables │ # ╰──────┴───────────╯ # main modules code cache rwx_code_cache_main="" # user modules code cache rwx_code_cache_user="" # 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}" # cache of all sourced code modules _rwx_code="" # cache for the parsing awk script _rwx_code_awk="$(cat "${rwx_main_root}/core/code.awk")" # cache for code aliases _rwx_code_aliases="" # cache for code aliases functions _rwx_code_aliases_functions="" # cache for code binaries _rwx_code_binaries="" # cache for code commands _rwx_code_commands="" # cache for code commands functions _rwx_code_commands_functions="" # cache for code constants _rwx_code_constants="" # cache for code functions _rwx_code_functions="" # cache for code variables _rwx_code_variables="" # ╭──────┬───────╮ # │ code │ cache │ # ╰──────┴───────╯ # output all cached code rwx_code_cache() { rwx_code_cache_main rwx_code_cache_user } # output cached main code rwx_code_cache_main() { echo "${rwx_code_cache_main}" } # output cached user code rwx_code_cache_user() { echo "${rwx_code_cache_user}" } # ╭──────┬──────╮ # │ code │ help │ # ╰──────┴──────╯ # output help message rwx_code_help() { rwx_log "" \ "rwx_… = functions" \ " a__… = aliases" \ " u__… = user" } # ╭──────┬─────────╮ # │ code │ install │ # ╰──────┴─────────╯ #/ rwx_install rwx_code_install() { local target="${1}" local command file name root # code if [ -n "${target}" ]; then root="${target}${rwx_main_root}" rwx_remove "${root}" cp --recursive "${rwx_main_root}" "${root}" fi # commands root="${target}/usr/local/bin" name="${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}" file="${root}/${name}" rwx_remove "${file}" rwx_link "${file}" "${rwx_main_path}" while IFS= read -r command; do file="${root}/${command}" rwx_remove "${file}" rwx_link "${file}" "${name}" done <