Add error handling for non-git situations

GSoC/Meterpreter_Web_Console
Erin Bleiweiss 2018-09-26 17:32:40 -05:00
parent b3053020d1
commit 0b48d2371d
No known key found for this signature in database
GPG Key ID: F69B2138BD594660
1 changed files with 6 additions and 1 deletions

View File

@ -221,7 +221,12 @@ class Msf::Ui::Console::CommandDispatcher::Developer
end
def cmd_reload_diff_files
files = %x(git diff --name-only).split
output = %x(git diff --name-only 2>&1)
if output.include?('Not a git repository')
print_error 'No git repository found.'
return
end
files = output.split
files.each do | file |
reload_file(file)
end