Land #9505, Support local knowledge base documents
commit
b9c1a64d20
|
@ -29,12 +29,16 @@ module Msf
|
|||
# @param mod [Msf::Module] Module to create document for.
|
||||
# @return [void]
|
||||
def self.get_module_document(mod)
|
||||
md = ''
|
||||
|
||||
kb_path = File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md")
|
||||
kb_path = nil
|
||||
kb = ''
|
||||
|
||||
if File.exist?(kb_path)
|
||||
if File.exists?(File.join(PullRequestFinder::USER_MANUAL_BASE_PATH, "#{mod.fullname}.md"))
|
||||
kb_path = File.join(PullRequestFinder::USER_MANUAL_BASE_PATH, "#{mod.fullname}.md")
|
||||
elsif File.exists?(File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md"))
|
||||
kb_path = File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md")
|
||||
end
|
||||
|
||||
unless kb_path.nil?
|
||||
File.open(kb_path, 'rb') { |f| kb = f.read }
|
||||
end
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ module Msf
|
|||
class Exception < RuntimeError; end
|
||||
|
||||
MANUAL_BASE_PATH = File.expand_path(File.join(Msf::Config.module_directory, '..', 'documentation', 'modules' ))
|
||||
USER_MANUAL_BASE_PATH = File.expand_path(File.join(Msf::Config.user_module_directory, '..', 'documentation', 'modules' ))
|
||||
|
||||
# @return [Octokit::Client] Git client
|
||||
attr_accessor :git_client
|
||||
|
|
Loading…
Reference in New Issue