mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

Don’t rely on having external commands always present in the PATH in order to find them. Instead, provide an accessory method to Tap so they can be added and used when needed. While we’re here, do some general refactoring and cleanup of the command code in these places.
11 lines
262 B
Ruby
11 lines
262 B
Ruby
module Commands
|
|
def self.path(cmd)
|
|
[
|
|
HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.sh",
|
|
HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.sh",
|
|
HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb",
|
|
HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb",
|
|
].find(&:exist?)
|
|
end
|
|
end
|