Skip to content

Commit

Permalink
Use Rex::Compat.open_file to open profiling report
Browse files Browse the repository at this point in the history
MSP-11368

Use Rex::Compat.open_file instead of `system('open <pdf>')` so that
opening the pdf works on Linux in addition to OSX.
  • Loading branch information
limhoff-r7 committed Sep 19, 2014
1 parent b863978 commit 9b92d0d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions msfconsole
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9b92d0d

Please sign in to comment.