Skip to content

Commit 577baf6

Browse files
committed
Add a check for .rb in cmd_edit
1 parent 5288887 commit 577baf6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ def cmd_edit(*args)
9595
system(editor, path)
9696

9797
# XXX: This will try to reload *anything* and break on modules
98-
if args.length > 0
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)