diff --git a/sh/file.sh b/sh/file.sh new file mode 100644 index 0000000..becca76 --- /dev/null +++ b/sh/file.sh @@ -0,0 +1,26 @@ +# ╭──────╮ +# │ file │ +# ╰──────╯ + +rwx_file_append() { + local file="${1}" + local text="${2}" + if [ -n "${file}" ]; then + printf "%s" "${text}" >>"${file}" + fi +} + +rwx_file_empty() { + local file="${1}" + if [ -n "${file}" ]; then + rwx_file_write "${file}" "" + fi +} + +rwx_file_write() { + local file="${1}" + local text="${2}" + if [ -n "${file}" ]; then + printf "%s" "${text}" >"${file}" + fi +} diff --git a/sh/main.sh b/sh/main.sh index 40fbf17..78c7677 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -1,5 +1,9 @@ #! /usr/bin/env sh +# ╭──────╮ +# │ main │ +# ╰──────╯ + # ╭──────┬───────────╮ # │ main │ constants │ # ╰──────┴───────────╯ @@ -127,12 +131,12 @@ rwx_source() { # run initial steps rwx_main() { - # system root + # source system root if ! rwx_source "${RWX_ROOT_SYSTEM}"; then __rwx_log "Not a directory: ${RWX_ROOT_SYSTEM}" return 1 fi - # user root + # source user root rwx_source "${RWX_SELF_USER}" # context / command if [ -n "${RWX_COMMAND_NAME}" ]; then diff --git a/sh/tmux.sh b/sh/tmux.sh index 0294e7f..a29ec26 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -1,3 +1,7 @@ +# ╭──────╮ +# │ tmux │ +# ╰──────╯ + # ╭──────┬───────╮ # │ tmux │ setup │ # ╰──────┴───────╯ diff --git a/sh/util.sh b/sh/util.sh index cbcd67a..a3c53bf 100644 --- a/sh/util.sh +++ b/sh/util.sh @@ -1,25 +1,6 @@ -rwx_file_append() { - local file="${1}" - local text="${2}" - if [ -n "${file}" ]; then - printf "%s" "${text}" >>"${file}" - fi -} - -rwx_file_empty() { - local file="${1}" - if [ -n "${file}" ]; then - rwx_file_write "${file}" "" - fi -} - -rwx_file_write() { - local file="${1}" - local text="${2}" - if [ -n "${file}" ]; then - printf "%s" "${text}" >"${file}" - fi -} +# ╭──────╮ +# │ util │ +# ╰──────╯ rwx_link() { local link="${1}"