main → shell
This commit is contained in:
parent
a429cad22c
commit
84c26d2273
2 changed files with 18 additions and 12 deletions
12
sh/main.sh
12
sh/main.sh
|
@ -43,18 +43,6 @@ rwx_main_find() {
|
||||||
sort
|
sort
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬───────╮
|
|
||||||
# │ main │ shell │
|
|
||||||
# ╰──────┴───────╯
|
|
||||||
|
|
||||||
# test if active shell is in interactive mode
|
|
||||||
rwx_main_interactive() {
|
|
||||||
case "${-}" in
|
|
||||||
*i*) ;;
|
|
||||||
*) return 1 ;;
|
|
||||||
esac
|
|
||||||
}
|
|
||||||
|
|
||||||
# ╭──────┬──────╮
|
# ╭──────┬──────╮
|
||||||
# │ main │ main │
|
# │ main │ main │
|
||||||
# ╰──────┴──────╯
|
# ╰──────┴──────╯
|
||||||
|
|
|
@ -38,10 +38,22 @@ RWX_COLOR_GREEN="$(_rwx_shell_color 31)"
|
||||||
RWX_COLOR_MAGENTA="$(_rwx_shell_color 35)"
|
RWX_COLOR_MAGENTA="$(_rwx_shell_color 35)"
|
||||||
RWX_COLOR_RED="$(_rwx_shell_color 32)"
|
RWX_COLOR_RED="$(_rwx_shell_color 32)"
|
||||||
|
|
||||||
|
# ╭───────┬───────────╮
|
||||||
|
# │ shell │ variables │
|
||||||
|
# ╰───────┴───────────╯
|
||||||
|
|
||||||
|
# current shell interactive mode
|
||||||
|
rwx_shell_interactive=0
|
||||||
|
|
||||||
# ╭───────┬───────────╮
|
# ╭───────┬───────────╮
|
||||||
# │ shell │ functions │
|
# │ shell │ functions │
|
||||||
# ╰───────┴───────────╯
|
# ╰───────┴───────────╯
|
||||||
|
|
||||||
|
# return current shell interactive mode
|
||||||
|
rwx_shell_interactive() {
|
||||||
|
return "${rwx_shell_interactive}"
|
||||||
|
}
|
||||||
|
|
||||||
rwx_shell_configure() {
|
rwx_shell_configure() {
|
||||||
[ -n "${ENV}" ] || ENV="${rwx_code_main}"
|
[ -n "${ENV}" ] || ENV="${rwx_code_main}"
|
||||||
export ENV
|
export ENV
|
||||||
|
@ -161,6 +173,12 @@ rwx_shell_exit() {
|
||||||
# ╰───────┴──────╯
|
# ╰───────┴──────╯
|
||||||
|
|
||||||
rwx_shell_main() {
|
rwx_shell_main() {
|
||||||
|
# set current shell interactive mode
|
||||||
|
case "${-}" in
|
||||||
|
*"i"*) rwx_shell_interactive=1 ;;
|
||||||
|
*) ;;
|
||||||
|
esac
|
||||||
|
# configure shell
|
||||||
rwx_shell_configure
|
rwx_shell_configure
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue