aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorXu Cheng2015-09-10 21:20:34 +0800
committerXu Cheng2015-09-12 19:15:45 +0800
commitce390b9bd9648f1edf856df55e121c7d75cfdedc (patch)
tree179fb47ce96852c991f99205a0828959d6f76fc7 /Library/Homebrew/cmd
parentfa9c7cdc8ebb3c526e23c602ebd9030d84a8f7a0 (diff)
downloadbrew-ce390b9bd9648f1edf856df55e121c7d75cfdedc.tar.bz2
add dev-cmd folder
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/command.rb4
-rw-r--r--Library/Homebrew/cmd/commands.rb8
-rw-r--r--Library/Homebrew/cmd/update-test.rb26
3 files changed, 8 insertions, 30 deletions
diff --git a/Library/Homebrew/cmd/command.rb b/Library/Homebrew/cmd/command.rb
index 66a6d38e1..6ddd898be 100644
--- a/Library/Homebrew/cmd/command.rb
+++ b/Library/Homebrew/cmd/command.rb
@@ -3,7 +3,9 @@ module Homebrew
cmd = ARGV.first
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
elsif (path = which("brew-#{cmd}") || which("brew-#{cmd}.rb"))
puts path
diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb
index 2bb18b3e0..b94ecca7d 100644
--- a/Library/Homebrew/cmd/commands.rb
+++ b/Library/Homebrew/cmd/commands.rb
@@ -20,9 +20,11 @@ module Homebrew
def internal_commands
with_directory = false
- (HOMEBREW_REPOSITORY/"Library/Homebrew/cmd").
- children(with_directory).
- map { |f| File.basename(f, ".rb") }
+ cmds = (HOMEBREW_LIBRARY_PATH/"cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
+ if ARGV.homebrew_developer?
+ cmds += (HOMEBREW_LIBRARY_PATH/"dev-cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
+ end
+ cmds
end
def external_commands
diff --git a/Library/Homebrew/cmd/update-test.rb b/Library/Homebrew/cmd/update-test.rb
deleted file mode 100644
index 61b119672..000000000
--- a/Library/Homebrew/cmd/update-test.rb
+++ /dev/null
@@ -1,26 +0,0 @@
-require "extend/ENV"
-
-module Homebrew
- def update_test
- homebrew_repository_git = HOMEBREW_REPOSITORY/".git"
-
- mktemp do
- curdir = Pathname.new(Dir.pwd)
-
- # copy Homebrew installation
- cp_r homebrew_repository_git, curdir/".git"
- safe_system "git", "checkout", "--force", "master"
- safe_system "git", "reset", "--hard", "origin/master"
-
- # Set git origin
- safe_system "git", "config", "remote.origin.url", "file://#{homebrew_repository_git}"
-
- # update ENV["PATH"]
- ENV.extend(Stdenv)
- ENV.prepend_path "PATH", "#{curdir}/bin"
-
- # run brew update
- safe_system "brew", "update"
- end
- end
-end