Compare commits
No commits in common. "5c5464d4ae8b41e8a519dd5c147946f9f9c371a1" and "715a13e871694ae796ff25b2dff0ad48bf3b8081" have entirely different histories.
5c5464d4ae
...
715a13e871
3 changed files with 29 additions and 31 deletions
38
sh/main.sh
38
sh/main.sh
|
@ -94,11 +94,11 @@ rwx_source() {
|
||||||
[ -d "${root}" ] ||
|
[ -d "${root}" ] ||
|
||||||
return 1
|
return 1
|
||||||
local file="${2}"
|
local file="${2}"
|
||||||
local count module modules
|
local count module
|
||||||
count=0
|
count=0
|
||||||
__rwx_log "" \
|
__rwx_log "" \
|
||||||
". ${root}"
|
". ${root}"
|
||||||
modules="$(rwx_find_shell "${root}" "${file}")"
|
local modules="$(rwx_find_shell "${root}" "${file}")"
|
||||||
while IFS= read -r module; do
|
while IFS= read -r module; do
|
||||||
count=$((count + 1))
|
count=$((count + 1))
|
||||||
__rwx_log "$(printf "%02d" "${count}") ${module%.sh}"
|
__rwx_log "$(printf "%02d" "${count}") ${module%.sh}"
|
||||||
|
@ -231,23 +231,23 @@ rwx_parse_variables() {
|
||||||
|
|
||||||
#= rt
|
#= rt
|
||||||
rwx_test() {
|
rwx_test() {
|
||||||
local item
|
local item
|
||||||
set \
|
set \
|
||||||
"main" \
|
"main" \
|
||||||
"alias/git" \
|
"alias/git" \
|
||||||
\
|
\
|
||||||
"RWX_MAIN_NAME" \
|
"RWX_MAIN_NAME" \
|
||||||
\
|
\
|
||||||
"_rwx_code" \
|
"_rwx_code" \
|
||||||
\
|
\
|
||||||
"rwx_cache" \
|
"rwx_cache" \
|
||||||
\
|
\
|
||||||
"alias/batcat" \
|
"alias/batcat" \
|
||||||
"b"
|
"b"
|
||||||
for item in "${@}"; do
|
for item in "${@}"; do
|
||||||
echo
|
echo
|
||||||
rwx_doc "${item}"
|
rwx_doc "${item}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬─────╮
|
# ╭──────┬─────╮
|
||||||
|
|
14
sh/self.sh
14
sh/self.sh
|
@ -4,31 +4,31 @@
|
||||||
# show the cached code
|
# show the cached code
|
||||||
#= rc
|
#= rc
|
||||||
rwx_code() {
|
rwx_code() {
|
||||||
echo "${_rwx_code}"
|
echo "${_rwx_code}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# show the cached aliases
|
# show the cached aliases
|
||||||
#= rca
|
#= rca
|
||||||
rwx_code_aliases() {
|
rwx_code_aliases() {
|
||||||
echo "${RWX_ALIASES}"
|
echo "${RWX_ALIASES}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# show the cached constants
|
# show the cached constants
|
||||||
#= rcc
|
#= rcc
|
||||||
rwx_code_constants() {
|
rwx_code_constants() {
|
||||||
echo "${RWX_CONSTANTS}"
|
echo "${RWX_CONSTANTS}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# show the cached functions
|
# show the cached functions
|
||||||
#= rcf
|
#= rcf
|
||||||
rwx_code_functions() {
|
rwx_code_functions() {
|
||||||
echo "${RWX_FUNCTIONS}"
|
echo "${RWX_FUNCTIONS}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# show the cached variables
|
# show the cached variables
|
||||||
#= rcv
|
#= rcv
|
||||||
rwx_code_variables() {
|
rwx_code_variables() {
|
||||||
echo "${_rwx_code_variables}"
|
echo "${_rwx_code_variables}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# meta doc
|
# meta doc
|
||||||
|
@ -222,10 +222,10 @@ rwx_self_write() {
|
||||||
local target="${1}"
|
local target="${1}"
|
||||||
if [ -n "${target}" ]; then
|
if [ -n "${target}" ]; then
|
||||||
shift
|
shift
|
||||||
local file files text
|
local file text
|
||||||
text="#! /usr/bin/env sh
|
text="#! /usr/bin/env sh
|
||||||
"
|
"
|
||||||
files="$(rwx_self_subset "${@}")"
|
local files="$(rwx_self_subset "${@}")"
|
||||||
while IFS= read -r file; do
|
while IFS= read -r file; do
|
||||||
text="${text}
|
text="${text}
|
||||||
$(cat "${RWX_ROOT_SYSTEM}/${file}")
|
$(cat "${RWX_ROOT_SYSTEM}/${file}")
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#= tma
|
#= tma
|
||||||
rwx_tmux_attach() {
|
rwx_tmux_attach() {
|
||||||
local server="${1}"
|
local server="${1}"
|
||||||
if [ -n "${server}" ]; then
|
if [ "${server}" ]; then
|
||||||
tmux -L "${server}" attach-session
|
tmux -L "${server}" attach-session
|
||||||
else
|
else
|
||||||
rwx_tmux_list
|
rwx_tmux_list
|
||||||
|
@ -17,7 +17,7 @@ rwx_tmux_attach() {
|
||||||
#= tmk
|
#= tmk
|
||||||
rwx_tmux_kill() {
|
rwx_tmux_kill() {
|
||||||
local server="${1}"
|
local server="${1}"
|
||||||
if [ -n "${server}" ]; then
|
if [ "${server}" ]; then
|
||||||
tmux -L "${server}" kill-server 2>"/dev/null"
|
tmux -L "${server}" kill-server 2>"/dev/null"
|
||||||
else
|
else
|
||||||
rwx_tmux_list
|
rwx_tmux_list
|
||||||
|
@ -27,9 +27,7 @@ rwx_tmux_kill() {
|
||||||
# list
|
# list
|
||||||
#= tml
|
#= tml
|
||||||
rwx_tmux_list() {
|
rwx_tmux_list() {
|
||||||
local user_id
|
ls "/tmp/tmux-$(id --user)"
|
||||||
user_id="$(id --user)"
|
|
||||||
ls "/tmp/tmux-${user_id}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# ╭──────┬───────╮
|
# ╭──────┬───────╮
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue