Navigation Menu

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

fix: Prevent unbound variable error with nounset in asdf.sh #1158

Merged
merged 1 commit into from Jan 19, 2022

Conversation

joehorsnell
Copy link
Contributor

@joehorsnell joehorsnell commented Jan 13, 2022

Summary

asdf v0.9.0 included a bug fix to not override an existing ASDF_DIR.

However, if ASDF_DIR is not set at all, then this causes an error when using bash set -u, or set -o nounset - see here for additional info.

asdf.sh: line 6: ASDF_DIR: unbound variable

Edit: see also #160 and #817

@joehorsnell joehorsnell requested a review from a team as a code owner January 13, 2022 18:05
@joehorsnell joehorsnell changed the title Prevent nounset errors in asdf.sh Prevent unbound variable error with nounse in asdf.sh Jan 13, 2022
@joehorsnell joehorsnell changed the title Prevent unbound variable error with nounse in asdf.sh Prevent unbound variable error with nounset in asdf.sh Jan 13, 2022
@joehorsnell joehorsnell changed the title Prevent unbound variable error with nounset in asdf.sh fix : Prevent unbound variable error with nounset in asdf.sh Jan 14, 2022
@joehorsnell joehorsnell changed the title fix : Prevent unbound variable error with nounset in asdf.sh fix: Prevent unbound variable error with nounset in asdf.sh Jan 14, 2022
`asdf` [v0.9.0][1] included a [bug fix][2] to not override an existing ASDF_DIR.

However, if `ASDF_DIR` is not set at all, then this causes an error when using bash `set -u`, or
`set -o nounset` - see [here][3] for additional info.

[1]: https://github.com/asdf-vm/asdf/releases/tag/v0.9.0
[2]: asdf-vm#1008
[3]: https://mywiki.wooledge.org/BashFAQ/112
@Stratus3D
Copy link
Member

Sorry for the late review here @joehorsnell ! As a general rule we require issues to be reported prior to contributing a fix. However I see that this a fairly trivial one-line fix, so assuming tests pass I will go ahead and merge it. Thanks for the contributing the fix and the tests to prevent a regression!

@Stratus3D Stratus3D merged commit b7dd291 into asdf-vm:master Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants