summaryrefslogtreecommitdiff
path: root/lib/bundler/cli/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/cli/config.rb')
-rw-r--r--lib/bundler/cli/config.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb
index 8d2aba0916..e1222c75dd 100644
--- a/lib/bundler/cli/config.rb
+++ b/lib/bundler/cli/config.rb
@@ -180,7 +180,7 @@ module Bundler
scopes = %w[global local].select {|s| options[s] }
case scopes.size
when 0
- @scope = "global"
+ @scope = inside_app? ? "local" : "global"
@explicit_scope = false
when 1
@scope = scopes.first
@@ -189,6 +189,15 @@ module Bundler
"The options #{scopes.join " and "} were specified. Please only use one of the switches at a time."
end
end
+
+ private
+
+ def inside_app?
+ Bundler.root
+ true
+ rescue GemfileNotFound
+ false
+ end
end
end
end