summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinichi Maeshima <netwillnet@gmail.com>2026-05-07 19:03:03 +0900
committergit <svn-admin@ruby-lang.org>2026-05-08 08:08:05 +0000
commitc9ee9c1e23ac27cf2699a41e221e05d82f30e4c3 (patch)
tree46e2e95d8844a729b78178a9090d2d80956250ab
parent842c847c79d57de4c2d9b3199679fceaab839899 (diff)
[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. https://github.com/ruby/rubygems/commit/8fd32cb611
-rw-r--r--lib/bundler/cli/config.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
index 8248e3b15b..976cda7484 100644
--- a/lib/bundler/cli/config.rb
+++ b/lib/bundler/cli/config.rb
@@ -97,10 +97,10 @@ module Bundler
confirm(name)
end
- if current_value
- return
- else
+ if current_value.nil?
exit 1
+ else
+ return
end
end