Verified Commit 26bee836 authored by Balasankar C's avatar Balasankar C Committed by Ian Baum
Browse files

Copy complete license text to LICENSE file

parent fe557d7d
......@@ -248,7 +248,8 @@ module Omnibus
unless license_files.empty?
out << "For details, see:\n"
license_files.each do |license_file|
out << "#{license_package_location(name, license_file)}\n"
path = license_package_location(name, license_file)
out << "#{license_content(path)}\n"
end
end
out << "\n"
......@@ -257,6 +258,25 @@ module Omnibus
out
end
# Reads the content of the license file
# It is in the form of:
# ...
# MIT License
# Permission is hereby granted, free of charge, to any person obtaining
# ...
#
# @return [String]
#
def license_content(path)
if File.exist?(path)
File.read(path)
else
path
end
end
#
# Summary of the licenses of the transitive dependencies of the project.
# It is in the form of:
......@@ -282,9 +302,13 @@ module Omnibus
out << "This product includes #{dep_name} #{dep_version}\n"
out << "which is a '#{dep_mgr_name}' dependency of #{projects},\n"
out << "and which is available under a '#{dep_data["license"]}' License.\n"
out << "For details, see:\n"
out << files.join("\n")
out << "\n\n"
if !files.empty?
out << "Details:\n"
files.each do |license_file|
out << "#{license_content(license_file)}\n"
end
end
out << "\n"
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