mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
tap-info: drop commands' brew(cask)
naming requirement
This commit is contained in:
parent
bbdb72c5d5
commit
897f2bc225
@ -1,5 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require "commands"
|
||||||
require "extend/cachable"
|
require "extend/cachable"
|
||||||
require "readall"
|
require "readall"
|
||||||
require "description_cache_store"
|
require "description_cache_store"
|
||||||
@ -474,17 +475,10 @@ class Tap
|
|||||||
@command_dir ||= path/"cmd"
|
@command_dir ||= path/"cmd"
|
||||||
end
|
end
|
||||||
|
|
||||||
def command_file?(file)
|
|
||||||
file = Pathname.new(file) unless file.is_a? Pathname
|
|
||||||
file = file.expand_path(path)
|
|
||||||
file.parent == command_dir && file.basename.to_s.match?(/^brew(cask)?-/) &&
|
|
||||||
(file.executable? || file.extname == ".rb")
|
|
||||||
end
|
|
||||||
|
|
||||||
# An array of all commands files of this {Tap}.
|
# An array of all commands files of this {Tap}.
|
||||||
def command_files
|
def command_files
|
||||||
@command_files ||= if command_dir.directory?
|
@command_files ||= if command_dir.directory?
|
||||||
command_dir.children.select(&method(:command_file?))
|
Commands.find_commands(command_dir)
|
||||||
else
|
else
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
@ -533,9 +527,9 @@ class Tap
|
|||||||
"official" => official?,
|
"official" => official?,
|
||||||
"formula_names" => formula_names,
|
"formula_names" => formula_names,
|
||||||
"formula_files" => formula_files.map(&:to_s),
|
"formula_files" => formula_files.map(&:to_s),
|
||||||
"command_files" => command_files.map(&:to_s),
|
|
||||||
"cask_tokens" => cask_tokens,
|
"cask_tokens" => cask_tokens,
|
||||||
"cask_files" => cask_files.map(&:to_s),
|
"cask_files" => cask_files.map(&:to_s),
|
||||||
|
"command_files" => command_files.map(&:to_s),
|
||||||
"pinned" => pinned?,
|
"pinned" => pinned?,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user