mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
20 lines
492 B
Ruby
20 lines
492 B
Ruby
#: * `--prefix`:
|
|
#: Display Homebrew's install path. *Default:* `/usr/local` on macOS and `/home/linuxbrew/.linuxbrew` on Linux
|
|
#:
|
|
#: * `--prefix` <formula>:
|
|
#: Display the location in the cellar where <formula> is or would be installed.
|
|
|
|
module Homebrew
|
|
module_function
|
|
|
|
def __prefix
|
|
if ARGV.named.empty?
|
|
puts HOMEBREW_PREFIX
|
|
else
|
|
puts ARGV.resolved_formulae.map { |f|
|
|
f.opt_prefix.exist? ? f.opt_prefix : f.installed_prefix
|
|
}
|
|
end
|
|
end
|
|
end
|