Skip to content

Commit 8258680

Browse files
committed
Land rapid7#8048, Only enumerate files during build
Only enumerate framework files in gemspec when building a gem
2 parents a712688 + 8207302 commit 8258680

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

metasploit-framework.gemspec

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
# we must manually define the project root
55
if ENV['MSF_ROOT']
66
lib = File.realpath(File.expand_path('lib', ENV['MSF_ROOT']))
7+
files = `git ls-files`.split($/).reject { |file|
8+
file =~ /^documentation|^data\/gui|^external/
9+
}
710
else
8-
# have to use realpath as metasploit-framework is often loaded through a symlink and tools like Coverage and debuggers
9-
# require realpaths.
11+
# have to use realpath as metasploit-framework is often loaded through a
12+
# symlink and tools like Coverage and debuggers require realpaths.
1013
lib = File.realpath(File.expand_path('../lib', __FILE__))
14+
files = []
1115
end
1216

1317
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
@@ -24,10 +28,8 @@ Gem::Specification.new do |spec|
2428
spec.homepage = 'https://www.metasploit.com'
2529
spec.license = 'BSD-3-clause'
2630

27-
spec.files = `git ls-files`.split($/).reject { |file|
28-
file =~ /^documentation|^data\/gui|^external/
29-
}
30-
spec.bindir = '.'
31+
spec.files = files
32+
spec.bindir = '.'
3133
if ENV['CREATE_BINSTUBS']
3234
spec.executables = [
3335
'msfconsole',

0 commit comments

Comments
 (0)