Compare commits
3 commits
465f0ba475
...
222b64f109
Author | SHA1 | Date | |
---|---|---|---|
222b64f109 | |||
0d47b0916c | |||
415a59bca7 |
3 changed files with 6 additions and 24 deletions
|
@ -3,12 +3,10 @@ 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}")"
|
||||||
rwx_ifs_set
|
printf "%s\n" "${modules}" | while IFS= read -r module; do
|
||||||
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}"
|
||||||
}
|
}
|
||||||
|
|
17
sh/main.sh
17
sh/main.sh
|
@ -132,23 +132,6 @@ 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 │
|
||||||
# ╰──────┴──────╯
|
# ╰──────┴──────╯
|
||||||
|
|
|
@ -181,13 +181,14 @@ rwx_self_write() {
|
||||||
local file text
|
local file text
|
||||||
text="#! /usr/bin/env sh
|
text="#! /usr/bin/env sh
|
||||||
"
|
"
|
||||||
rwx_ifs_set
|
local files="$(rwx_self_subset "${@}")"
|
||||||
for file in $(rwx_self_subset "${@}"); do
|
while IFS= read -r file; do
|
||||||
text="${text}
|
text="${text}
|
||||||
$(cat "${RWX_ROOT_SYSTEM}/${file}")
|
$(cat "${RWX_ROOT_SYSTEM}/${file}")
|
||||||
"
|
"
|
||||||
done
|
done <<EOF
|
||||||
rwx_ifs_unset
|
${files}
|
||||||
|
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}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue