Class: Homebrew::DevCmd::UpdateLicenseData

Inherits:
AbstractCommand show all
Includes:
SystemCommand::Mixin
Defined in:
dev-cmd/update-license-data.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods included from SystemCommand::Mixin

#system_command, #system_command!

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



21
22
23
24
25
26
27
28
29
30
31
# File 'dev-cmd/update-license-data.rb', line 21

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