Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Add check for BUNDLE_GEMFILE in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
agrim123 committed Mar 7, 2018
1 parent ffe58a3 commit c858364
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@ def initialize(*args)
super

custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]

if ENV["BUNDLE_GEMFILE"] && !ENV["BUNDLE_GEMFILE"].empty?
custom_gemfile = ENV["BUNDLE_GEMFILE"]
end

if custom_gemfile && !custom_gemfile.empty?
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
if !ENV["BUNDLE_GEMFILE"]
Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
end

Bundler.reset_paths!
end

Expand Down

0 comments on commit c858364

Please sign in to comment.