Commit 4b1594aa authored by Balasankar C's avatar Balasankar C Committed by Balasankar C

Copy complete license text to LICENSE file

parent 5d5e8779
......@@ -247,9 +247,10 @@ module Omnibus
out << "This product bundles #{name} #{version},\n"
out << "which is available under a \"#{license}\" License.\n"
if !license_files.empty?
out << "For details, see:\n"
out << "Details:\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"
......@@ -258,6 +259,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:
......@@ -283,9 +303,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