Compare commits
No commits in common. "222b64f109b32fc2d4e7edfa5648bec2dffb274a" and "465f0ba475f67c24adda2e5440ffec49d17bd8ba" have entirely different histories.
222b64f109
...
465f0ba475
3 changed files with 24 additions and 6 deletions
|
@ -3,10 +3,12 @@ rwx_shellcheck() {
|
|||
local file module modules path
|
||||
file="$(mktemp)"
|
||||
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}"
|
||||
echo ". \"${path}\"" >>"${file}"
|
||||
done
|
||||
rwx_ifs_unset
|
||||
rwx_shellcheck_file "${file}"
|
||||
rwx_remove "${file}"
|
||||
}
|
||||
|
|
17
sh/main.sh
17
sh/main.sh
|
@ -132,6 +132,23 @@ rwx_shell_interactive() {
|
|||
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 │
|
||||
# ╰──────┴──────╯
|
||||
|
|
|
@ -181,14 +181,13 @@ rwx_self_write() {
|
|||
local file text
|
||||
text="#! /usr/bin/env sh
|
||||
"
|
||||
local files="$(rwx_self_subset "${@}")"
|
||||
while IFS= read -r file; do
|
||||
rwx_ifs_set
|
||||
for file in $(rwx_self_subset "${@}"); do
|
||||
text="${text}
|
||||
$(cat "${RWX_ROOT_SYSTEM}/${file}")
|
||||
"
|
||||
done <<EOF
|
||||
${files}
|
||||
EOF
|
||||
done
|
||||
rwx_ifs_unset
|
||||
rwx_file_write "${target}" "${text}"
|
||||
rwx_shfmt "${target}"
|
||||
rwx_shellcheck_file "${target}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue