aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorChristianBundy2013-11-10 16:27:36 -0600
committerMike McQuaid2013-11-11 14:07:24 +0000
commitccf8976547eabc4882505babb3cc0cb208356ab2 (patch)
treeb69127f63b330faaa9bff5cd243cbd1f3361fde1 /Library
parent9dcfcc936d6d4b2b92e4fcc029cd23ee0e979eb7 (diff)
downloadhomebrew-ccf8976547eabc4882505babb3cc0cb208356ab2.tar.bz2
brew-bundle: add new command to support Brewfiles.
Closes #24107. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmd/brew-bundle.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Contributions/cmd/brew-bundle.rb b/Library/Contributions/cmd/brew-bundle.rb
new file mode 100755
index 000000000..31dd4d264
--- /dev/null
+++ b/Library/Contributions/cmd/brew-bundle.rb
@@ -0,0 +1,17 @@
+# Looks for a Brewfile and runs each line as a brew command. For example:
+#
+# tap foo/bar
+# install spark
+#
+# Saving the above commands in a Brewfile and running `brew bundle` will run
+# the commands `brew tap foo/bar` and `brew install spark` automagically.
+#
+# Current discussion: https://github.com/mxcl/homebrew/pull/24107
+
+raise "Cannot find Brewfile" if not File.exist?('Brewfile')
+File.readlines('Brewfile').each do |line|
+ command = line.chomp
+ if not command.empty? and not command.chars.first == '#'
+ `brew #{command}`
+ end
+end