mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
35 lines
787 B
Ruby
35 lines
787 B
Ruby
# typed: strict
|
|
# frozen_string_literal: true
|
|
|
|
require "abstract_command"
|
|
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
|
|
end
|