diff --git a/sh/lint/shellcheck.sh b/sh/lint/shellcheck.sh index ac8c700..0cbe758 100644 --- a/sh/lint/shellcheck.sh +++ b/sh/lint/shellcheck.sh @@ -3,12 +3,10 @@ rwx_shellcheck() { local file module modules path file="$(mktemp)" modules="$(rwx_find_shell "${root}")" - rwx_ifs_set - for module in ${modules}; do + printf "%s\n" "${modules}" | while IFS= read -r module; do path="${root}/${module}" echo ". \"${path}\"" >>"${file}" done - rwx_ifs_unset rwx_shellcheck_file "${file}" rwx_remove "${file}" } diff --git a/sh/main.sh b/sh/main.sh index 75036ef..48e7f08 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -132,23 +132,6 @@ 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 │ # ╰──────┴──────╯ diff --git a/sh/self.sh b/sh/self.sh index a7ebca2..dfbe203 100644 --- a/sh/self.sh +++ b/sh/self.sh @@ -181,13 +181,14 @@ rwx_self_write() { local file text text="#! /usr/bin/env sh " - rwx_ifs_set - for file in $(rwx_self_subset "${@}"); do + local files="$(rwx_self_subset "${@}")" + while IFS= read -r file; do text="${text} $(cat "${RWX_ROOT_SYSTEM}/${file}") " - done - rwx_ifs_unset + done <