summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-07-28 16:27:20 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-07-28 16:27:20 -0700
commit186d5df86ca277a472ace05f0e3ed4b1028816ec (patch)
treea99006c004eaa2871309b8a7db3187b91d28fcfd /lib/bundler/cli.rb
parenteb070cd314c3a112662cf134f41c1163f0e6a2be (diff)
downloadbundler-186d5df86ca277a472ace05f0e3ed4b1028816ec.tar.gz
bundle install --system overrides a previous install location
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r--lib/bundler/cli.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 61fcf7db21..3047f32d61 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -99,13 +99,21 @@ module Bundler
"Do not attempt to fetch gems remotely and use the gem cache instead"
method_option "binstubs", :type => :string, :lazy_default => "bin", :banner =>
"Generate bin stubs for bundled gems to ./bin"
+ method_option "system", :type => :boolean
def install(path = nil)
opts = options.dup
opts[:without] ||= []
opts[:without].map! { |g| g.to_sym }
+ if path && options[:system]
+ Bundler.ui.error "You have specified both a path to install your gems to, \n" \
+ "as well as --system. Please choose."
+ exit 1
+ end
+
# Can't use Bundler.settings for this because settings needs gemfile.dirname
ENV['BUNDLE_GEMFILE'] = opts[:gemfile] if opts[:gemfile]
+ Bundler.settings[:path] = nil if options[:system]
Bundler.settings[:path] = path if path
Bundler.settings[:bin] = opts["binstubs"] if opts[:binstubs]
Bundler.settings[:disable_shared_gems] = '1' if options["disable-shared-gems"] || path