Skip to content

Commit 63544d0

Browse files
Raise an error when license file is missing
1 parent 03222d9 commit 63544d0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tool/automatiek/gem.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,17 @@ def namespace_files(folder)
115115
end
116116

117117
def clean
118-
files = Dir.glob("#{vendor_lib}/*", File::FNM_DOTMATCH).reject do |f|
118+
all_files = Dir.glob("#{vendor_lib}/*", File::FNM_DOTMATCH)
119+
120+
unless all_files.include?("#{vendor_lib}/#{license_path}")
121+
raise "#{license_path} was not found in gem #{gem_name}. The gem includes the following files:\n * #{all_files.join("\n * ")}"
122+
end
123+
124+
files = all_files.reject do |f|
119125
basename = f.split("/").last
120126
allowlist.include? basename
121127
end
128+
122129
FileUtils.rm_r files
123130
end
124131

0 commit comments

Comments
 (0)