commands: ensure internal commands are files
`Pathname#children(with_directory = false)` doesn't filter directories, instead it returns path with basename. Closes Homebrew/homebrew#45325. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
f6cf1a4025
commit
1248294c8c
@ -27,13 +27,11 @@ module Homebrew
|
||||
end
|
||||
|
||||
def internal_commands
|
||||
with_directory = false
|
||||
(HOMEBREW_LIBRARY_PATH/"cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
|
||||
(HOMEBREW_LIBRARY_PATH/"cmd").children.select(&:file?).map { |f| f.basename(".rb").to_s }
|
||||
end
|
||||
|
||||
def internal_development_commands
|
||||
with_directory = false
|
||||
(HOMEBREW_LIBRARY_PATH/"dev-cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
|
||||
(HOMEBREW_LIBRARY_PATH/"dev-cmd").children.select(&:file?).map { |f| f.basename(".rb").to_s }
|
||||
end
|
||||
|
||||
def external_commands
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user