Skip to content

Commit 7595c7c

Browse files
committed
Land rapid7#9194, Add a check for .rb in cmd_edit
2 parents 5288887 + 97859eb commit 7595c7c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/msf/ui/console/command_dispatcher/modules.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ def cmd_edit(*args)
9494
print_status("Launching #{editor} #{path}")
9595
system(editor, path)
9696

97-
# XXX: This will try to reload *anything* and break on modules
98-
if args.length > 0
97+
# XXX: This will try to reload *any* .rb and break on modules
98+
if args.length > 0 && path.end_with?('.rb')
9999
print_status("Reloading #{path}")
100100
load path
101+
else
102+
print_error('Only Ruby files can be reloaded')
101103
end
102104
else
103105
print_error('Nothing to edit -- try using a module first.')

0 commit comments

Comments
 (0)