Skip to content

Commit

Permalink
Don't assume that the RUBYLIB environment variable exists
Browse files Browse the repository at this point in the history
When run under asdf-direnv with direnv's `strict_env` set to true, then
this script will run with bash's `nounset` enabled, which will cause
this script to crash in the following way:

  ./exec-env:6: RUBYLIB: unbound variable

(see asdf-community/asdf-direnv#115 for
details)

I know this doesn't affect regular asdf users, but this seems like a
reasonable change to make, I hope you'll accept it!
  • Loading branch information
jfly committed Mar 27, 2022
1 parent 811c824 commit ac598e8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bin/exec-env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
current_script_path=${BASH_SOURCE[0]}
ruby_plugin_dir=$(dirname "$(dirname "$current_script_path")")

RUBYLIB=${RUBYLIB:-}
if [ "$RUBYLIB" = "" ]; then
export RUBYLIB="$ruby_plugin_dir/rubygems-plugin"
else
Expand Down

0 comments on commit ac598e8

Please sign in to comment.