Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kierenevans
Copy link
Collaborator

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.

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

sroze commented Mar 23, 2017

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

What do you mean?

@kierenevans
Copy link
Collaborator Author

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 kierenevans changed the base branch from master to main November 5, 2020 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants