Use Rex::Compat.open_file to open profiling report

MSP-11368

Use Rex::Compat.open_file instead of `system('open <pdf>')` so that
opening the pdf works on Linux in addition to OSX.
bug/bundler_fix
Luke Imhoff 2014-09-19 11:13:28 -05:00
parent b863978028
commit 9b92d0d6d4
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 4 additions and 5 deletions

View File

@ -27,13 +27,12 @@ if ENV['METASPLOIT_FRAMEWORK_PROFILE'] == 'true'
puts "Generating pdf"
pdf_pathname = "#{profile_pathname}.pdf"
pdf_path = "#{profile_pathname}.pdf"
if Bundler.clean_system("pprof.rb --pdf #{profile_pathname} > #{pdf_path}")
puts "PDF saved to #{pdf_path}"
if Bundler.clean_system("pprof.rb --pdf #{profile_pathname} > #{pdf_pathname}")
puts "PDF saved to #{pdf_pathname}"
system("open #{pdf_pathname}")
Rex::Compat.open_file(pdf_path)
end
}
end