File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,11 @@ def cmd_edit_help
77
77
# Edit the currently active module or a local file
78
78
#
79
79
def cmd_edit ( *args )
80
+ editing_module = false
80
81
if args . length > 0
81
82
path = args [ 0 ]
82
83
elsif active_module
84
+ editing_module = true
83
85
path = active_module . file_path
84
86
end
85
87
@@ -95,14 +97,16 @@ def cmd_edit(*args)
95
97
system ( *editor . split , path )
96
98
97
99
# XXX: This will try to reload *any* .rb and break on modules
98
- if args . length > 0 && path . end_with? ( '.rb' )
99
- print_status ( "Reloading #{ path } " )
100
- load path
101
- else
102
- print_error ( 'Only Ruby files can be reloaded (use reload/rerun for modules)' )
100
+ if !editing_module
101
+ if path . end_with? ( '.rb' )
102
+ print_status ( "Reloading #{ path } " )
103
+ load path
104
+ else
105
+ print_error ( "Only library files can be reloaded after editing (use reload/rerun for modules)" )
106
+ end
103
107
end
104
108
else
105
- print_error ( 'Nothing to edit -- try using a module first.' )
109
+ print_error ( 'Nothing to edit -- try using a module first, or specifying a library file to edit .' )
106
110
end
107
111
end
108
112
You can’t perform that action at this time.
0 commit comments