brew-bundle: add new command to support Brewfiles.

Closes #24107.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
ChristianBundy authored and Mike McQuaid committed 2013-11-11 14:07:24 +00:00
1 parent 9dcfcc936d
commit ccf8976547
1 file changed
+17
+17
View File
@@ -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