mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-14 00:44:18 +01:00
Address code review: capture exit code explicitly in fallback error message
Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
@@ -217,12 +217,16 @@ run_one_script() {
|
||||
"$script" || _run_rc=$?
|
||||
if [ "$_run_rc" -eq 126 ] && [ -n "${BASHIO_LIB:-}" ]; then
|
||||
echo "Direct exec failed (rc=126, likely E2BIG), retrying via source in subshell..."
|
||||
_run_rc=0
|
||||
(
|
||||
# shellcheck disable=SC1090
|
||||
. "$BASHIO_LIB" 2>/dev/null || true
|
||||
# shellcheck disable=SC1090
|
||||
. "$script"
|
||||
) || echo -e "\033[0;31mError\033[0m : $script exiting $?"
|
||||
) || _run_rc=$?
|
||||
if [ "$_run_rc" -ne 0 ]; then
|
||||
echo -e "\033[0;31mError\033[0m : $script exiting $_run_rc"
|
||||
fi
|
||||
elif [ "$_run_rc" -ne 0 ]; then
|
||||
echo -e "\033[0;31mError\033[0m : $script exiting $_run_rc"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user