diff --git a/sh/main.sh b/sh/main.sh index f51b918..75b1815 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -94,11 +94,11 @@ rwx_source() { [ -d "${root}" ] || return 1 local file="${2}" - local count module + local count module modules count=0 __rwx_log "" \ ". ${root}" - local modules="$(rwx_find_shell "${root}" "${file}")" + modules="$(rwx_find_shell "${root}" "${file}")" while IFS= read -r module; do count=$((count + 1)) __rwx_log "$(printf "%02d" "${count}") ${module%.sh}" @@ -231,23 +231,23 @@ rwx_parse_variables() { #= rt rwx_test() { - local item - set \ - "main" \ - "alias/git" \ - \ - "RWX_MAIN_NAME" \ - \ - "_rwx_code" \ - \ - "rwx_cache" \ - \ - "alias/batcat" \ - "b" - for item in "${@}"; do - echo - rwx_doc "${item}" - done + local item + set \ + "main" \ + "alias/git" \ + \ + "RWX_MAIN_NAME" \ + \ + "_rwx_code" \ + \ + "rwx_cache" \ + \ + "alias/batcat" \ + "b" + for item in "${@}"; do + echo + rwx_doc "${item}" + done } # ╭──────┬─────╮ diff --git a/sh/self.sh b/sh/self.sh index e2c30f7..4d88414 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -4,31 +4,31 @@ # show the cached code #= rc rwx_code() { - echo "${_rwx_code}" + echo "${_rwx_code}" } # show the cached aliases #= rca rwx_code_aliases() { - echo "${RWX_ALIASES}" + echo "${RWX_ALIASES}" } # show the cached constants #= rcc rwx_code_constants() { - echo "${RWX_CONSTANTS}" + echo "${RWX_CONSTANTS}" } # show the cached functions #= rcf rwx_code_functions() { - echo "${RWX_FUNCTIONS}" + echo "${RWX_FUNCTIONS}" } # show the cached variables #= rcv rwx_code_variables() { - echo "${_rwx_code_variables}" + echo "${_rwx_code_variables}" } # meta doc @@ -222,10 +222,10 @@ rwx_self_write() { local target="${1}" if [ -n "${target}" ]; then shift - local file text + local file files text text="#! /usr/bin/env sh " - local files="$(rwx_self_subset "${@}")" + files="$(rwx_self_subset "${@}")" while IFS= read -r file; do text="${text} $(cat "${RWX_ROOT_SYSTEM}/${file}") diff --git a/sh/tmux.sh b/sh/tmux.sh index 85a616f..9213e01 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -6,7 +6,7 @@ #= tma rwx_tmux_attach() { local server="${1}" - if [ "${server}" ]; then + if [ -n "${server}" ]; then tmux -L "${server}" attach-session else rwx_tmux_list @@ -17,7 +17,7 @@ rwx_tmux_attach() { #= tmk rwx_tmux_kill() { local server="${1}" - if [ "${server}" ]; then + if [ -n "${server}" ]; then tmux -L "${server}" kill-server 2>"/dev/null" else rwx_tmux_list @@ -27,7 +27,9 @@ rwx_tmux_kill() { # list #= tml rwx_tmux_list() { - ls "/tmp/tmux-$(id --user)" + local user_id + user_id="$(id --user)" + ls "/tmp/tmux-${user_id}" } # ╭──────┬───────╮