aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2013-11-11 14:07:18 +0000
committerMike McQuaid2013-11-11 14:07:37 +0000
commitfcaef1a39b5ae7e3351f9e8f4a4265770c4b5388 (patch)
tree765b199af34913bd3454ff2afc3e6577cf32826e
parentccf8976547eabc4882505babb3cc0cb208356ab2 (diff)
downloadhomebrew-fcaef1a39b5ae7e3351f9e8f4a4265770c4b5388.tar.bz2
brew-bundle: general cleanup.
-rwxr-xr-xLibrary/Contributions/cmd/brew-bundle.rb23
1 files changed, 13 insertions, 10 deletions
diff --git a/Library/Contributions/cmd/brew-bundle.rb b/Library/Contributions/cmd/brew-bundle.rb
index 31dd4d264..a533c093e 100755
--- a/Library/Contributions/cmd/brew-bundle.rb
+++ b/Library/Contributions/cmd/brew-bundle.rb
@@ -1,17 +1,20 @@
-# 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
# 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
+# Running `brew bundle` will run the commands `brew tap foo/bar`
+# and `brew install spark`.
+
+raise 'Cannot find Brewfile' unless File.exist? 'Brewfile'
-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
+ command = line.chomp
+ next if command.empty?
+ next if command.chars.first == '#'
+
+ system "brew #{command}"
end