Skip to content

Commit c9ee9c1

Browse files
willnetmatzbot
authored andcommitted
[ruby/rubygems] Return exit status 1 only when the config value is nil
When using something like `bundle config set foo false`, the config value is converted via `Bundler::Settings#converted_value`, so the stored value becomes `false` instead of the string `"false"`. Because of that, passing `Bundler.settings[name]` directly to an `if` statement can execute `exit 1` even when the value is actually configured. Since config values do not appear to become `nil` explicitly, use `nil?` to determine whether the value is configured. ruby/rubygems@8fd32cb611
1 parent 842c847 commit c9ee9c1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/bundler/cli/config.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ def run
9797
confirm(name)
9898
end
9999

100-
if current_value
101-
return
102-
else
100+
if current_value.nil?
103101
exit 1
102+
else
103+
return
104104
end
105105
end
106106

0 commit comments

Comments
 (0)