outdated: Fail when user supplies formulae and some are outdated
This commit is contained in:
parent
a3da9fa350
commit
966131f768
@ -53,13 +53,9 @@ module Homebrew
|
|||||||
if args.formula_only? || !args.cask_only? && args.json
|
if args.formula_only? || !args.cask_only? && args.json
|
||||||
formulae = args.resolved_formulae.blank? ? Formula.installed : args.resolved_formulae
|
formulae = args.resolved_formulae.blank? ? Formula.installed : args.resolved_formulae
|
||||||
outdated = print_outdated_formulae(formulae)
|
outdated = print_outdated_formulae(formulae)
|
||||||
|
|
||||||
Homebrew.failed = !formulae.blank? && !outdated.blank?
|
|
||||||
elsif args.cask_only?
|
elsif args.cask_only?
|
||||||
casks = args.named.blank? ? Cask::Caskroom.casks : args.named
|
casks = args.named.blank? ? Cask::Caskroom.casks : args.named
|
||||||
outdated = print_outdated_casks(casks)
|
outdated = print_outdated_casks(casks)
|
||||||
|
|
||||||
Homebrew.failed = !casks.blank? && !outdated.blank?
|
|
||||||
else
|
else
|
||||||
formulae, casks = args.resolved_formulae_casks
|
formulae, casks = args.resolved_formulae_casks
|
||||||
|
|
||||||
@ -68,11 +64,10 @@ module Homebrew
|
|||||||
casks = Cask::Caskroom.casks
|
casks = Cask::Caskroom.casks
|
||||||
end
|
end
|
||||||
|
|
||||||
outdated_formulae = print_outdated_formulae(formulae)
|
outdated = print_outdated_formulae(formulae) + print_outdated_casks(casks)
|
||||||
outdated_casks = print_outdated_casks(casks)
|
|
||||||
|
|
||||||
Homebrew.failed = !formulae.blank? && !outdated_formulae.blank? || !casks.blank? && !outdated_casks.blank?
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Homebrew.failed = args.named.present? && outdated.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def print_outdated_formulae(formulae)
|
def print_outdated_formulae(formulae)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user