Merge pull request #16566 from dduugg/fix-update-sponsors
Add SystemCommand::Mixin to all commands using system_command
This commit is contained in:
commit
190563cf92
@ -5,12 +5,13 @@ require "metafiles"
|
|||||||
require "formula"
|
require "formula"
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
require "cask/list"
|
require "cask/list"
|
||||||
|
require "system_command"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
extend SystemCommand::Mixin
|
||||||
|
|
||||||
sig { returns(CLI::Parser) }
|
sig { returns(CLI::Parser) }
|
||||||
def list_args
|
def self.list_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
List all installed formulae and casks.
|
List all installed formulae and casks.
|
||||||
@ -64,7 +65,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def list
|
def self.list
|
||||||
args = list_args.parse
|
args = list_args.parse
|
||||||
|
|
||||||
if args.full_name?
|
if args.full_name?
|
||||||
@ -121,7 +122,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def filtered_list(args:)
|
def self.filtered_list(args:)
|
||||||
names = if args.no_named?
|
names = if args.no_named?
|
||||||
Formula.racks
|
Formula.racks
|
||||||
else
|
else
|
||||||
@ -150,7 +151,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_casks(args:)
|
def self.list_casks(args:)
|
||||||
casks = if args.no_named?
|
casks = if args.no_named?
|
||||||
Cask::Caskroom.casks
|
Cask::Caskroom.casks
|
||||||
else
|
else
|
||||||
|
|||||||
@ -6,6 +6,7 @@ require "cask/download"
|
|||||||
require "cask/installer"
|
require "cask/installer"
|
||||||
require "cask/cask_loader"
|
require "cask/cask_loader"
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
|
require "system_command"
|
||||||
require "tap"
|
require "tap"
|
||||||
require "unversioned_cask_checker"
|
require "unversioned_cask_checker"
|
||||||
|
|
||||||
|
|||||||
@ -4,12 +4,13 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
require "completions"
|
require "completions"
|
||||||
require "manpages"
|
require "manpages"
|
||||||
|
require "system_command"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
extend SystemCommand::Mixin
|
||||||
|
|
||||||
sig { returns(CLI::Parser) }
|
sig { returns(CLI::Parser) }
|
||||||
def generate_man_completions_args
|
def self.generate_man_completions_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Generate Homebrew's manpages and shell completions.
|
Generate Homebrew's manpages and shell completions.
|
||||||
@ -18,7 +19,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def generate_man_completions
|
def self.generate_man_completions
|
||||||
args = generate_man_completions_args.parse
|
args = generate_man_completions_args.parse
|
||||||
|
|
||||||
Commands.rebuild_internal_commands_completion_list
|
Commands.rebuild_internal_commands_completion_list
|
||||||
|
|||||||
@ -6,12 +6,10 @@ require "utils/spdx"
|
|||||||
require "system_command"
|
require "system_command"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
include SystemCommand::Mixin
|
extend SystemCommand::Mixin
|
||||||
|
|
||||||
module_function
|
|
||||||
|
|
||||||
sig { returns(CLI::Parser) }
|
sig { returns(CLI::Parser) }
|
||||||
def update_license_data_args
|
def self.update_license_data_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Update SPDX license data in the Homebrew repository.
|
Update SPDX license data in the Homebrew repository.
|
||||||
@ -20,7 +18,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_license_data
|
def self.update_license_data
|
||||||
update_license_data_args.parse
|
update_license_data_args.parse
|
||||||
|
|
||||||
SPDX.download_latest_license_data!
|
SPDX.download_latest_license_data!
|
||||||
|
|||||||
@ -4,12 +4,13 @@
|
|||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
require "utils/github"
|
require "utils/github"
|
||||||
require "manpages"
|
require "manpages"
|
||||||
|
require "system_command"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
extend SystemCommand::Mixin
|
||||||
|
|
||||||
sig { returns(CLI::Parser) }
|
sig { returns(CLI::Parser) }
|
||||||
def update_maintainers_args
|
def self.update_maintainers_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Update the list of maintainers in the `Homebrew/brew` README.
|
Update the list of maintainers in the `Homebrew/brew` README.
|
||||||
@ -19,7 +20,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_maintainers
|
def self.update_maintainers
|
||||||
update_maintainers_args.parse
|
update_maintainers_args.parse
|
||||||
|
|
||||||
# We assume that only public members wish to be included in the README
|
# We assume that only public members wish to be included in the README
|
||||||
|
|||||||
@ -3,15 +3,16 @@
|
|||||||
|
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
require "utils/github"
|
require "utils/github"
|
||||||
|
require "system_command"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
extend SystemCommand::Mixin
|
||||||
|
|
||||||
NAMED_MONTHLY_AMOUNT = 100
|
NAMED_MONTHLY_AMOUNT = 100
|
||||||
URL_MONTHLY_AMOUNT = 1000
|
URL_MONTHLY_AMOUNT = 1000
|
||||||
|
|
||||||
sig { returns(CLI::Parser) }
|
sig { returns(CLI::Parser) }
|
||||||
def update_sponsors_args
|
def self.update_sponsors_args
|
||||||
Homebrew::CLI::Parser.new do
|
Homebrew::CLI::Parser.new do
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Update the list of GitHub Sponsors in the `Homebrew/brew` README.
|
Update the list of GitHub Sponsors in the `Homebrew/brew` README.
|
||||||
@ -21,19 +22,19 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def sponsor_name(sponsor)
|
def self.sponsor_name(sponsor)
|
||||||
sponsor[:name] || sponsor[:login]
|
sponsor[:name] || sponsor[:login]
|
||||||
end
|
end
|
||||||
|
|
||||||
def sponsor_logo(sponsor)
|
def self.sponsor_logo(sponsor)
|
||||||
"https://github.com/#{sponsor[:login]}.png?size=64"
|
"https://github.com/#{sponsor[:login]}.png?size=64"
|
||||||
end
|
end
|
||||||
|
|
||||||
def sponsor_url(sponsor)
|
def self.sponsor_url(sponsor)
|
||||||
"https://github.com/#{sponsor[:login]}"
|
"https://github.com/#{sponsor[:login]}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_sponsors
|
def self.update_sponsors
|
||||||
update_sponsors_args.parse
|
update_sponsors_args.parse
|
||||||
|
|
||||||
named_sponsors = []
|
named_sponsors = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user