Commit 9ec32b1c authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg

Prefer Licence over Copying

parent c5d97c7e
...@@ -210,9 +210,13 @@ class Repository ...@@ -210,9 +210,13 @@ class Repository
def license def license
cache.fetch(:license) do cache.fetch(:license) do
tree(:head).blobs.find_all do |file| licenses = tree(:head).blobs.find_all do |file|
file.name =~ /\A(copying|license)/i file.name =~ /\A(copying|license)/i
end.last # Prefer `LICENSE` as filename over `COPYING` end
# If `licence`, `copying` and `copying.lesser` are found, return in the
# following order: licence, copying, copying.lesser
licenses.find { |l| l =~ /\Alicence/i } || licenses.sort.first
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment