Technical notes on web development, DevOps, and AI integration.
1 article
set -euo pipefail will not save a script from swapped arguments. Whitelist guards and custom exit codes at the entry point stop the waste.
TL;DR: The script ran to completion on swapped arguments because set -euo pipefail only catches unset variables, not wrong values. The fix: eight guard lines at the top that validate the recipe path, integer, and budget using simple case globs with custom exit codes 45 and 46. Validate at the trust boundary, quote variables, keep it lightweight.