Files
home/scripts
valknar d2bff00ee2 fix: prevent set -e crash when yq exits non-zero on IONOS
Two issues on IONOS shared hosting (very low ulimit -u):

1. bash 4.4+ propagates the exit code of command substitutions through
   `local var=$(cmd)`. When yq crashes (exit 2) the assignment itself
   returns 2, and set -e kills the script before any log message appears.
   Fixed by adding `|| return 0` to the yq wrapper so it always exits 0.

2. All ref_count comparisons checked for "null"/"0" but not for empty
   string. A yq call that produces no stdout (crashed but returned 0)
   leaves ref_count="", which neither guard caught — the arithmetic loop
   `i < ref_count` silently treated "" as 0 and skipped all references.
   Fixed by adding `[[ -z "$ref_count" ]]` to every ref_count guard.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 23:10:55 +02:00
..