aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-15 21:48:33 -0700
committerAdam Vandenberg2010-06-15 21:48:33 -0700
commit07914a48eece34d8f2ae1d91a0233199ac7c9dae (patch)
tree403c187e4e9854a42cbe9c83fdef7f67c9a4cefb /bin
parentb9bb07864270866600bdd39473cdf4abb922d2ac (diff)
downloadbrew-07914a48eece34d8f2ae1d91a0233199ac7c9dae.tar.bz2
Reduce nesting in 'brew up'.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew50
1 files changed, 24 insertions, 26 deletions
diff --git a/bin/brew b/bin/brew
index a9ae5a0ee..f7486e1d1 100755
--- a/bin/brew
+++ b/bin/brew
@@ -163,34 +163,32 @@ begin
end
when 'up', 'update'
- if system "/usr/bin/which -s git"
- require 'update'
- updater = RefreshBrew.new
- old_revision = updater.current_revision
- unless updater.update_from_masterbrew!
- puts "Already up-to-date."
+ abort "Please `brew install git' first." unless system "/usr/bin/which -s git"
+
+ require 'update'
+ updater = RefreshBrew.new
+ old_revision = updater.current_revision
+ unless updater.update_from_masterbrew!
+ puts "Already up-to-date."
+ else
+ puts "Updated Homebrew from #{old_revision[0,8]} to #{updater.current_revision[0,8]}."
+ ## New Formulae
+ if updater.pending_new_formulae?
+ ohai "The following formulae are new:"
+ puts_columns updater.added_formulae
+ end
+ ## Deleted Formulae
+ if updater.deleted_formulae?
+ ohai "The following formulae were removed:"
+ puts_columns updater.deleted_formulae
+ end
+ ## Updated Formulae
+ if updater.pending_formulae_changes?
+ ohai "The following formulae were updated:"
+ puts_columns updater.updated_formulae
else
- puts "Updated Homebrew from #{old_revision[0,8]} to #{updater.current_revision[0,8]}."
- ## New Formulae
- if updater.pending_new_formulae?
- ohai "The following formulae are new:"
- puts_columns updater.added_formulae
- end
- ## Deleted Formulae
- if updater.deleted_formulae?
- ohai "The following formulae were removed:"
- puts_columns updater.deleted_formulae
- end
- ## Updated Formulae
- if updater.pending_formulae_changes?
- ohai "The following formulae were updated:"
- puts_columns updater.updated_formulae
- else
- puts "No formulae were updated." unless updater.pending_formulae_changes?
- end
+ puts "No formulae were updated." unless updater.pending_formulae_changes?
end
- else
- abort "Please `brew install git' first."
end
when 'ln', 'link'