diff options
author | Andre Arko <andre@arko.net> | 2015-05-16 15:20:02 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-05-16 15:20:02 -0700 |
commit | 9eef958bf531e723aa84f2334708aa3dc3feabb0 (patch) | |
tree | f3e65c424a4cd3b5124e372b70fa0d4c23ae03d5 /lib/bundler/cli/config.rb | |
parent | 6506ac5419248a9426d9becd4d337375a9cd24f3 (diff) | |
download | bundler-9eef958bf531e723aa84f2334708aa3dc3feabb0.tar.gz |
skip config warning when new value is unchanged
Diffstat (limited to 'lib/bundler/cli/config.rb')
-rw-r--r-- | lib/bundler/cli/config.rb | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index 8d65e7c8..479e6f8a 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -46,26 +46,29 @@ module Bundler return end + new_value = args.join(" ") locations = Bundler.settings.locations(name) if scope == "global" - if local = locations[:local] - Bundler.ui.info "Your application has set #{name} to #{local.inspect}. This will override the " \ - "global value you are currently setting" + if locations[:local] + Bundler.ui.info "Your application has set #{name} to #{locations[:local].inspect}. " \ + "This will override the global value you are currently setting" end - if env = locations[:env] - Bundler.ui.info "You have a bundler environment variable for #{name} set to #{env.inspect}. " \ - "This will take precedence over the global value you are setting" + if locations[:env] + Bundler.ui.info "You have a bundler environment variable for #{name} set to " \ + "#{locations[:env].inspect}. This will take precedence over the global value you are setting" end - if global = locations[:global] and global != locations[:global] - Bundler.ui.info "You are replacing the current global value of #{name}, which is currently #{global.inspect}" + if locations[:global] && locations[:global] != new_value + Bundler.ui.info "You are replacing the current global value of #{name}, which is currently " \ + "#{locations[:global].inspect}" end end - if scope == "local" && local = locations[:local] - Bundler.ui.info "You are replacing the current local value of #{name}, which is currently #{local.inspect}" + if scope == "local" && locations[:local] != new_value + Bundler.ui.info "You are replacing the current local value of #{name}, which is currently " \ + "#{locations[:local].inspect}" end if name.match(/\Alocal\./) @@ -73,7 +76,7 @@ module Bundler self.args = [pathname.expand_path.to_s] if pathname.directory? end - Bundler.settings.send("set_#{scope}", name, args.join(" ")) + Bundler.settings.send("set_#{scope}", name, new_value) else Bundler.ui.error "Invalid scope --#{scope} given. Please use --local or --global." exit 1 |