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

Do not assume existence of any non-special parameters in exec-env. #58

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

BradenM
Copy link
Contributor

@BradenM BradenM commented Mar 27, 2022

When executing exec-env with bash's nounset flag enabled, it fails with multiple unbound variable errors.

-u Treat unset variables and parameters other than
the special parameters "@" and "*" as an error
when performing parameter expansion. If expansion
is attempted on an unset variable or parameter,
the shell prints an error message, and, if not
interactive, exits with a non-zero status.

see: https://man7.org/linux/man-pages/man1/bash.1.html

This is the case when using asdf-postgres with asdf-direnv with direnv configured as strict_env=true (which execs bash with: set -euo pipefail).

See the original issue here for details:
asdf-community/asdf-direnv#115

Thanks!

Copy link
Owner

@smashedtoatoms smashedtoatoms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wild, I would have never thought to check for this.

@smashedtoatoms smashedtoatoms merged commit ce9d3c6 into smashedtoatoms:master Mar 28, 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.

2 participants