Skip to content

Commit a99f00b

Browse files
author
qount25
committed
Accept a larger diversity of filenames for License
1 parent 4bd0cbf commit a99f00b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/pgpm/package/pgxn.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ def license
5959

6060
def license_text
6161
path = "#{self.source.to_s}"
62-
["LICENSE", "license", "License"].each do |fn|
63-
if File.exist?("#{path}/#{fn}")
64-
return File.read("#{path}/#{fn}")
62+
["license", "lisence", "unlicense", "unlisence", "copying"].each do |fn|
63+
[fn, fn.capitalize, fn.upcase].each do |fn2|
64+
["", ".txt", ".md"].each do |fn3|
65+
if File.exist?("#{path}/#{fn2}#{fn3}")
66+
return File.read("#{path}/#{fn2}#{fn3}")
67+
end
68+
end
6569
end
6670
end
6771
nil

0 commit comments

Comments
 (0)