Set -euo pipefail
My site’s build script has a set command; but what does it do? #!/usr/bin/env bash set -euo pipefail hugo --environment production --cleanDestinationDir git add public Here’s the breakdown of these flags: -e: Exit immediately if a command exits with a non-zero status -u: Treat unset variables as an error when substituting -o pipefail: (“Option pipefail”) The return value of a pipeline is the status of the last command to exit with a non-zero status, or zero if no command exited with a non-zero status These work together to make your script fail fast. As a sentence, they say: ...