D3992 ended up masking this error message. Since the custom error message is more informative, I decided to move set -u instead of removing the message entirely. Not having set -u set after simple error messages like this should have negligible effect.
- Group Reviewers
- rSTAGING79eec8bc0714: [build-configurations] Resurface the more informative error message when…
rABC79eec8bc0714: [build-configurations] Resurface the more informative error message when…
Result before patch:
./build-configurations.sh: line 7: ABC_BUILD_NAME: unbound variable
Result after patch:
+ '[' -z '' ']' + echo 'Error: Environment variable ABC_BUILD_NAME must be set' Error: Environment variable ABC_BUILD_NAME must be set + exit 1
This whole approach do not seem to make a lot of sense. The build build_names are not composable in any way, and as it is mandatory, it seems like it should be a parameters rather than an environment variable.
In any case, you can avoid the -u dance by conditionally setting the variable to an empty string and testing against this.