Compare commits

..

No commits in common. "222b64f109b32fc2d4e7edfa5648bec2dffb274a" and "465f0ba475f67c24adda2e5440ffec49d17bd8ba" have entirely different histories.

3 changed files with 24 additions and 6 deletions

View file

@ -3,10 +3,12 @@ rwx_shellcheck() {
local file module modules path local file module modules path
file="$(mktemp)" file="$(mktemp)"
modules="$(rwx_find_shell "${root}")" modules="$(rwx_find_shell "${root}")"
printf "%s\n" "${modules}" | while IFS= read -r module; do rwx_ifs_set
for module in ${modules}; do
path="${root}/${module}" path="${root}/${module}"
echo ". \"${path}\"" >>"${file}" echo ". \"${path}\"" >>"${file}"
done done
rwx_ifs_unset
rwx_shellcheck_file "${file}" rwx_shellcheck_file "${file}"
rwx_remove "${file}" rwx_remove "${file}"
} }

View file

@ -132,6 +132,23 @@ rwx_shell_interactive() {
esac esac
} }
# ╭──────┬─────╮
# │ main │ ifs │
# ╰──────┴─────╯
# set internal field separator to line feed
rwx_ifs_set() {
_RWX_IFS="${IFS}"
IFS="
"
}
# unset internal field separator
rwx_ifs_unset() {
IFS="${_RWX_IFS}"
unset RWX_IFS
}
# ╭──────┬──────╮ # ╭──────┬──────╮
# │ main │ find │ # │ main │ find │
# ╰──────┴──────╯ # ╰──────┴──────╯

View file

@ -181,14 +181,13 @@ rwx_self_write() {
local file text local file text
text="#! /usr/bin/env sh text="#! /usr/bin/env sh
" "
local files="$(rwx_self_subset "${@}")" rwx_ifs_set
while IFS= read -r file; do for file in $(rwx_self_subset "${@}"); do
text="${text} text="${text}
$(cat "${RWX_ROOT_SYSTEM}/${file}") $(cat "${RWX_ROOT_SYSTEM}/${file}")
" "
done <<EOF done
${files} rwx_ifs_unset
EOF
rwx_file_write "${target}" "${text}" rwx_file_write "${target}" "${text}"
rwx_shfmt "${target}" rwx_shfmt "${target}"
rwx_shellcheck_file "${target}" rwx_shellcheck_file "${target}"