This commit is contained in:
parent
bfcfde3520
commit
13ab4b8ec7
3 changed files with 9 additions and 6 deletions
|
@ -6,8 +6,6 @@
|
||||||
# │ code │ variables │
|
# │ 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
|
# main modules names
|
||||||
rwx_code_modules_main=""
|
rwx_code_modules_main=""
|
||||||
# user modules names
|
# user modules names
|
||||||
|
@ -67,7 +65,7 @@ rwx_code_install() {
|
||||||
name="${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}"
|
name="${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}"
|
||||||
file="${root}/${name}"
|
file="${root}/${name}"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
rwx_link "${file}" "${rwx_code_main}"
|
rwx_link "${file}" "${rwx_main_path}"
|
||||||
while IFS= read -r command; do
|
while IFS= read -r command; do
|
||||||
file="${root}/${command}"
|
file="${root}/${command}"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
|
@ -79,12 +77,12 @@ EOF
|
||||||
file="${target}/etc/profile.d/${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}"
|
file="${target}/etc/profile.d/${RWX_MAIN_NAME}.${RWX_MAIN_EXTENSION}"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
rwx_file_write "${file}" "\
|
rwx_file_write "${file}" "\
|
||||||
export ENV=\"${rwx_code_main}\"
|
export ENV=\"${rwx_main_path}\"
|
||||||
"
|
"
|
||||||
# bash
|
# bash
|
||||||
file="${target}/etc/bash.bashrc"
|
file="${target}/etc/bash.bashrc"
|
||||||
rwx_remove "${file}"
|
rwx_remove "${file}"
|
||||||
rwx_link "${file}" "${rwx_code_main}"
|
rwx_link "${file}" "${rwx_main_path}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬───────╮
|
# ╭──────┬───────╮
|
||||||
|
|
|
@ -22,6 +22,11 @@ RWX_MAIN_EXTENSION="sh"
|
||||||
|
|
||||||
# project main root directory
|
# project main root directory
|
||||||
rwx_main_root="${RWX_MAIN_PARENT}/${RWX_MAIN_NAME}"
|
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 │
|
# │ main │ find │
|
||||||
|
|
|
@ -55,7 +55,7 @@ rwx_shell_interactive() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rwx_shell_configure() {
|
rwx_shell_configure() {
|
||||||
[ -n "${ENV}" ] || ENV="${rwx_code_main}"
|
[ -n "${ENV}" ] || ENV="${rwx_main_path}"
|
||||||
export ENV
|
export ENV
|
||||||
# prompt
|
# prompt
|
||||||
PS1="\$(rwx_shell_prompt \${?})"
|
PS1="\$(rwx_shell_prompt \${?})"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue