Skip to content

Commit

Permalink
Ensure omnibus on windows can be rebuilt multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Apr 30, 2024
1 parent 0008a23 commit aa54f6f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion config/software/metasploit-framework.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
name "metasploit-framework"

# Detect a local checkout of metasploit-framework at '../metasploit-framework' - i.e. for the scenario of:
# - c:/temp/metasploit-omnibus
# - c:/temp/metasploit-framework (A local checkout of framework to use during the build process)
# but try and use 'C:/metasploit-framework' - as that's the metasploit-omnibus artifacts output directory
def has_windows_metasploit_framework_repo?
windows? && File.exist?('../metasploit-framework') && File.expand_path(File.join(Dir.pwd, "..", "metasploit-framework")) != "c:/metasploit-framework"
end

if linux? && File.exist?("/metasploit-framework")
# supply current version of metasploit-framework at root of filesystem
source path: "/metasploit-framework"
elsif windows? && File.exist?('../metasploit-framework')
elsif has_windows_metasploit_framework_repo?
# supply current version of metasploit-framework relative to the current directory
source path: "../metasploit-framework"
else
Expand Down

0 comments on commit aa54f6f

Please sign in to comment.