add dev-cmd folder
This commit is contained in:
parent
fa9c7cdc8e
commit
ce390b9bd9
@ -3,7 +3,9 @@ module Homebrew
|
|||||||
cmd = ARGV.first
|
cmd = ARGV.first
|
||||||
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)
|
cmd = HOMEBREW_INTERNAL_COMMAND_ALIASES.fetch(cmd, cmd)
|
||||||
|
|
||||||
if (path = HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb") && path.file?
|
if (path = HOMEBREW_LIBRARY_PATH/"cmd/#{cmd}.rb").file?
|
||||||
|
puts path
|
||||||
|
elsif ARGV.homebrew_developer? && (path = HOMEBREW_LIBRARY_PATH/"dev-cmd/#{cmd}.rb").file?
|
||||||
puts path
|
puts path
|
||||||
elsif (path = which("brew-#{cmd}") || which("brew-#{cmd}.rb"))
|
elsif (path = which("brew-#{cmd}") || which("brew-#{cmd}.rb"))
|
||||||
puts path
|
puts path
|
||||||
|
@ -20,9 +20,11 @@ module Homebrew
|
|||||||
|
|
||||||
def internal_commands
|
def internal_commands
|
||||||
with_directory = false
|
with_directory = false
|
||||||
(HOMEBREW_REPOSITORY/"Library/Homebrew/cmd").
|
cmds = (HOMEBREW_LIBRARY_PATH/"cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
|
||||||
children(with_directory).
|
if ARGV.homebrew_developer?
|
||||||
map { |f| File.basename(f, ".rb") }
|
cmds += (HOMEBREW_LIBRARY_PATH/"dev-cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
|
||||||
|
end
|
||||||
|
cmds
|
||||||
end
|
end
|
||||||
|
|
||||||
def external_commands
|
def external_commands
|
||||||
|
@ -106,7 +106,13 @@ begin
|
|||||||
# Add SCM wrappers.
|
# Add SCM wrappers.
|
||||||
ENV["PATH"] += "#{File::PATH_SEPARATOR}#{HOMEBREW_LIBRARY}/ENV/scm"
|
ENV["PATH"] += "#{File::PATH_SEPARATOR}#{HOMEBREW_LIBRARY}/ENV/scm"
|
||||||
|
|
||||||
internal_cmd = require? HOMEBREW_LIBRARY_PATH.join("cmd", cmd) if cmd
|
if cmd
|
||||||
|
internal_cmd = require? HOMEBREW_LIBRARY_PATH.join("cmd", cmd)
|
||||||
|
|
||||||
|
if !internal_cmd && ARGV.homebrew_developer?
|
||||||
|
internal_cmd = require? HOMEBREW_LIBRARY_PATH.join("dev-cmd", cmd)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Usage instructions should be displayed if and only if one of:
|
# Usage instructions should be displayed if and only if one of:
|
||||||
# - a help flag is passed AND an internal command is matched
|
# - a help flag is passed AND an internal command is matched
|
||||||
|
Loading…
x
Reference in New Issue
Block a user