This commit is contained in:
Isaac Sloan 2018-02-20 00:07:01 -07:00
parent 5612dfa4df
commit 09fdd517bd
4 changed files with 30 additions and 5 deletions

View file

@ -3,12 +3,12 @@ require "./compiled_license/version"
module Compiled
module License
def self.display
{{ run("../compiled_license/licenses.cr").stringify }}
{{ run("./compiled_license/licenses.cr").stringify }}
end
end
end
if ARGV[0]? && ARGV[0]? == "--license"
puts Amber::Support::Licenses.display
puts Compiled::License.display
exit 0
end

View file

@ -1,4 +1,12 @@
licenses = String.build do |s|
if File.exists?("./LICENSE")
s.puts Dir.current.split("/").last.capitalize
s.puts "================================================================================"
s.puts File.read("./LICENSE")
s.puts "================================================================================"
s.puts "\n\n"
end
Dir.glob("./lib/*/LICENSE", "./lib/*/license").each do |path|
s.puts path.match(/^\.\/lib\/([^\/]+)\//).try(&.[1]).to_s.capitalize
s.puts "================================================================================"