formula_creator: autodetect license from GitHub when available

This commit is contained in:
Dustin Rodrigues 2020-09-04 00:12:05 -04:00
parent 793ab30bb0
commit 70c1f39ec0

View File

@ -75,6 +75,7 @@ module Homebrew
metadata = GitHub.repository(@user, @name) metadata = GitHub.repository(@user, @name)
@desc = metadata["description"] @desc = metadata["description"]
@homepage = metadata["homepage"] @homepage = metadata["homepage"]
@license = metadata["license"]["spdx_id"] if metadata["license"]
rescue GitHub::HTTPNotFoundError rescue GitHub::HTTPNotFoundError
# If there was no repository found assume the network connection is at # If there was no repository found assume the network connection is at
# fault rather than the input URL. # fault rather than the input URL.