Land #6633, install bundler on msfupdate conditionally

bug/bundler_fix
Louis Sato 2016-03-02 16:18:30 -06:00
commit 8b32f22a17
No known key found for this signature in database
GPG Key ID: 501290E4CECB7DF4
1 changed files with 8 additions and 1 deletions

View File

@ -185,7 +185,14 @@ class Msfupdate
system("git", "merge", "#{remote}/#{branch}")
stdout.puts "[*] Updating gems..."
begin
require 'bundler'
rescue LoadError
stderr.puts '[*] Installing bundler'
system('gem', 'install', 'bundler')
Gem.clear_paths
require 'bundler'
end
Bundler.with_clean_env do
system("bundle", "install")
end