Make check work with 'set -u'
This commit is contained in:
@@ -38,11 +38,11 @@ warn_on_missing_envvars() {
|
||||
local unset_envs=()
|
||||
local varnames=("$@")
|
||||
for varname in "${varnames[@]}"; do
|
||||
if [ -z "${!varname}" ]; then
|
||||
if [ -z "${!varname-}" ]; then
|
||||
unset_envs=("${unset_envs[@]}" "$varname")
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
if [ ${#unset_envs[@]} -gt 0 ]; then
|
||||
printf "The following env variables are recommended, but have not been set. This script may not work as expected: %s\n" "${unset_envs[*]}" >&2
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user