Land #9194, Add a check for .rb in cmd_edit
commit
7595c7c627
|
@ -94,10 +94,12 @@ module Msf
|
||||||
print_status("Launching #{editor} #{path}")
|
print_status("Launching #{editor} #{path}")
|
||||||
system(editor, path)
|
system(editor, path)
|
||||||
|
|
||||||
# XXX: This will try to reload *anything* and break on modules
|
# XXX: This will try to reload *any* .rb and break on modules
|
||||||
if args.length > 0
|
if args.length > 0 && path.end_with?('.rb')
|
||||||
print_status("Reloading #{path}")
|
print_status("Reloading #{path}")
|
||||||
load path
|
load path
|
||||||
|
else
|
||||||
|
print_error('Only Ruby files can be reloaded')
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
print_error('Nothing to edit -- try using a module first.')
|
print_error('Nothing to edit -- try using a module first.')
|
||||||
|
|
Loading…
Reference in New Issue