Class: Homebrew::Cmd::UpgradeCmd

Inherits:
AbstractCommand show all
Defined in:
cmd/upgrade.rb

Instance Attribute Summary

Attributes inherited from AbstractCommand

#args

Instance Method Summary collapse

Methods inherited from AbstractCommand

command, command_name, #initialize, parser

Constructor Details

This class inherits a constructor from Homebrew::AbstractCommand

Instance Method Details

#runvoid

This method returns an undefined value.



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'cmd/upgrade.rb', line 126

def run
  # Deprecated since this is now the default behavior.
  odeprecated "`brew upgrade --ignore-pinned`" if args.ignore_pinned?

  formulae, casks = args.named.to_resolved_formulae_to_casks
  # If one or more formulae are specified, but no casks were
  # specified, we want to make note of that so we don't
  # try to upgrade all outdated casks.
  only_upgrade_formulae = formulae.present? && casks.blank?
  only_upgrade_casks = casks.present? && formulae.blank?

  upgrade_outdated_formulae(formulae) unless only_upgrade_casks
  upgrade_outdated_casks(casks) unless only_upgrade_formulae

  Cleanup.periodic_clean!(dry_run: args.dry_run?)

  Homebrew.messages.display_messages(display_times: args.display_times?)
end