mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 05:14:04 +02: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=$?
|
"$script" || _run_rc=$?
|
||||||
if [ "$_run_rc" -eq 126 ] && [ -n "${BASHIO_LIB:-}" ]; then
|
if [ "$_run_rc" -eq 126 ] && [ -n "${BASHIO_LIB:-}" ]; then
|
||||||
echo "Direct exec failed (rc=126, likely E2BIG), retrying via source in subshell..."
|
echo "Direct exec failed (rc=126, likely E2BIG), retrying via source in subshell..."
|
||||||
|
_run_rc=0
|
||||||
(
|
(
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
. "$BASHIO_LIB" 2>/dev/null || true
|
. "$BASHIO_LIB" 2>/dev/null || true
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
. "$script"
|
. "$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
|
elif [ "$_run_rc" -ne 0 ]; then
|
||||||
echo -e "\033[0;31mError\033[0m : $script exiting $_run_rc"
|
echo -e "\033[0;31mError\033[0m : $script exiting $_run_rc"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user