# ╭──────╮ # │ code │ # ╰──────╯ # ╭──────┬───────────╮ # │ code │ variables │ # ╰──────┴───────────╯ # TODO variablize # path to the entrypoint main file of the project RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}" # user root directory of the project RWX_SELF_USER="${HOME}/${RWX_SELF_NAME}" # cache for the parsing awk script _rwx_code_awk="$(cat "${RWX_ROOT_SYSTEM}/code.awk")" # cache for code aliases _rwx_code_aliases="" # cache for code aliases functions _rwx_code_aliases_functions="" # cache for code commands _rwx_code_commands="" # cache for code constants _rwx_code_constants="" # cache for code functions _rwx_code_functions="" # cache for code variables _rwx_code_variables="" # ╭──────┬──────╮ # │ 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_ROOT_SYSTEM}" rwx_remove "${root}" cp --recursive "${RWX_ROOT_SYSTEM}" "${root}" fi # commands root="${target}/usr/local/bin" name="${RWX_SELF_NAME}.sh" 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 <