cmd/upgrade: required named args when upgrading from source
The --build-from-source flag can currently be used without specifying a formula by name but it doesn't behave the way you'd expect it to. It will upgrade everything using bottles if they are available and skip building things from source. This is intentional because we want to discourage non-developers from building packages from source since the result is less predictable. The change here is to error out in that case. It might be smarter to go through the entire deprecation cycle here just in case someone is using this in scripts.
This commit is contained in:
parent
f957e0e9fa
commit
200452e23d
@ -120,6 +120,10 @@ module Homebrew
|
||||
|
||||
sig { override.void }
|
||||
def run
|
||||
if args.build_from_source? && args.named.empty?
|
||||
raise ArgumentError, "--build-from-source requires at least one formula"
|
||||
end
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user