diff options
| author | Adam Vandenberg | 2010-06-15 21:48:33 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-06-15 21:48:33 -0700 |
| commit | 8f0261a964c26925a970b1bcbb2aad0dfee0526d (patch) | |
| tree | ff1c7b49b2f0b23a5e7c28f6872700990dda5ca0 | |
| parent | c134c8f9fa2c69e550e59b7362f3f162c54451a3 (diff) | |
| download | homebrew-8f0261a964c26925a970b1bcbb2aad0dfee0526d.tar.bz2 | |
Reduce nesting in 'brew up'.
| -rwxr-xr-x | bin/brew | 50 |
1 files changed, 24 insertions, 26 deletions
@@ -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' |
