Commit ed9f8b00 authored by Balasankar C's avatar Balasankar C Committed by Balasankar C
Browse files

Copy complete license text to LICENSE file

parent c10de1a0
...@@ -247,9 +247,10 @@ module Omnibus ...@@ -247,9 +247,10 @@ module Omnibus
out << "This product bundles #{name} #{version},\n" out << "This product bundles #{name} #{version},\n"
out << "which is available under a \"#{license}\" License.\n" out << "which is available under a \"#{license}\" License.\n"
if !license_files.empty? if !license_files.empty?
out << "For details, see:\n" out << "Details:\n"
license_files.each do |license_file| 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
end end
out << "\n" out << "\n"
...@@ -258,6 +259,25 @@ module Omnibus ...@@ -258,6 +259,25 @@ module Omnibus
out out
end 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. # Summary of the licenses of the transitive dependencies of the project.
# It is in the form of: # It is in the form of:
...@@ -283,9 +303,13 @@ module Omnibus ...@@ -283,9 +303,13 @@ module Omnibus
out << "This product includes #{dep_name} #{dep_version}\n" out << "This product includes #{dep_name} #{dep_version}\n"
out << "which is a '#{dep_mgr_name}' dependency of #{projects},\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 << "and which is available under a '#{dep_data["license"]}' License.\n"
out << "For details, see:\n" if !files.empty?
out << files.join("\n") out << "Details:\n"
out << "\n\n" files.each do |license_file|
out << "#{license_content(license_file)}\n"
end
end
out << "\n"
end end
end end
end end
......
Supports Markdown
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