dockerfiles icon indicating copy to clipboard operation
dockerfiles copied to clipboard

Error and quit if an unset variable is used in functions.

Open kierenevans opened this issue 8 years ago • 2 comments

Helps avoid rm -rf ${VAR}/* wiping /* if $VAR is not set, as it could wipe out mountpoints.

A few variables such as GITHUB_TOKEN are impacted, this PR will gradually build over time to ensure variables are declared before being used.

kierenevans avatar Mar 23 '17 13:03 kierenevans

this PR will gradually build over time to ensure variables are declared before being used

What do you mean?

sroze avatar Mar 23 '17 14:03 sroze

GITHUB_TOKEN is currently not set anywhere, but we check if it's set with if [ -n "${GITHUB_TOKEN}" ].

That would not work with this -u flag and would exit the script. We should declare that and other variables in env files before use.

kierenevans avatar Mar 23 '17 14:03 kierenevans