brew/Library/Homebrew/dev-cmd/update-license-data.rb

35 lines
787 B
Ruby
Raw Normal View History

# typed: strict
# frozen_string_literal: true
require "abstract_command"
2020-08-04 10:07:57 -07:00
require "utils/spdx"
require "system_command"
module Homebrew
module DevCmd
class UpdateLicenseData < AbstractCommand
include SystemCommand::Mixin
cmd_args do
description <<~EOS
Update SPDX license data in the Homebrew repository.
EOS
named_args :none
end
sig { override.void }
def run
SPDX.download_latest_license_data!
diff = system_command "git", args: [
"-C", HOMEBREW_REPOSITORY, "diff", "--exit-code", SPDX::DATA_PATH
]
if diff.status.success?
ofail "No changes to SPDX license data."
else
puts "SPDX license data updated."
end
end
end
end
2020-06-25 05:46:18 +08:00
end