Skip to content
Snippets Groups Projects
Commit f81ee032 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

brew-bundle: general cleanup.

parent 6f8692ba
No related branches found
No related tags found
No related merge requests found
# Looks for a Brewfile and runs each line as a brew command. For example: # brew-bundle.rb
# Looks for a "Brewfile" in the current directory and runs each line
# as a brew command.
# #
# For example, given a Brewfile with the following contents:
# tap foo/bar # tap foo/bar
# install spark # install spark
# #
# Saving the above commands in a Brewfile and running `brew bundle` will run # Running `brew bundle` will run the commands `brew tap foo/bar`
# the commands `brew tap foo/bar` and `brew install spark` automagically. # and `brew install spark`.
#
# Current discussion: https://github.com/mxcl/homebrew/pull/24107 raise 'Cannot find Brewfile' unless File.exist? 'Brewfile'
raise "Cannot find Brewfile" if not File.exist?('Brewfile')
File.readlines('Brewfile').each do |line| File.readlines('Brewfile').each do |line|
command = line.chomp command = line.chomp
if not command.empty? and not command.chars.first == '#' next if command.empty?
`brew #{command}` next if command.chars.first == '#'
end
system "brew #{command}"
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment