Made the output of updating a bit nicer and log more if --verbose.
This commit is contained in:
parent
bb03db8e6c
commit
3b8f3ad409
@ -27,7 +27,7 @@ class RefreshBrew
|
||||
end
|
||||
|
||||
def current_revision
|
||||
in_prefix { `#{REVISION_COMMAND}`.strip }
|
||||
in_prefix { execute(REVISION_COMMAND).strip }
|
||||
end
|
||||
|
||||
private
|
||||
@ -36,11 +36,17 @@ class RefreshBrew
|
||||
Dir.chdir(HOMEBREW_PREFIX) { yield }
|
||||
end
|
||||
|
||||
def execute(cmd)
|
||||
out = `#{cmd}`
|
||||
ohai "#{cmd}: #{out}" if ARGV.verbose?
|
||||
out
|
||||
end
|
||||
|
||||
def git_checkout_masterbrew!
|
||||
in_prefix { `#{CHECKOUT_COMMAND}` }
|
||||
in_prefix { execute CHECKOUT_COMMAND }
|
||||
end
|
||||
|
||||
def git_pull!
|
||||
in_prefix { `#{UPDATE_COMMAND}` }
|
||||
in_prefix { execute UPDATE_COMMAND }
|
||||
end
|
||||
end
|
||||
3
bin/brew
3
bin/brew
@ -113,10 +113,11 @@ begin
|
||||
when 'up', 'update'
|
||||
require 'refresh_brew'
|
||||
updater = RefreshBrew.new
|
||||
old_revision = updater.current_revision
|
||||
unless updater.update_from_masterbrew!
|
||||
ohai "Already up-to-date."
|
||||
else
|
||||
ohai "Updated Homebrew to: #{updater.current_revision}"
|
||||
ohai "Updated Homebrew from #{old_revision} to #{updater.current_revision}."
|
||||
if updater.pending_formulae_changes?
|
||||
ohai "The following formulae were updated: #{updater.updated_formulae.join(', ')}"
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user