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