diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 12dbc82b60..6ff3790946 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -123,7 +123,7 @@ module Homebrew [:switch, "--install-ask", { description: "Ask for confirmation before downloading and installing formulae. " \ "Print bottles and dependencies download size and install size.", - env: :install_ask, + env: :install_ask, }], ].each do |args| options = args.pop @@ -332,18 +332,19 @@ module Homebrew total_installed_size = 0 installed_formulae.each do |f| next unless (bottle = f.bottle) + # keep it quiet as there could be a lot of json fetch, it’s not intuitive to show them all. bottle.fetch_tab(quiet: !args.debug?) total_download_size += T.must(bottle.bottle_size) if bottle.bottle_size total_installed_size += T.must(bottle.installed_size) if bottle.installed_size sized_formulae.push(f, f.recursive_dependencies) - unless f.deps.empty? - f.recursive_dependencies.each do |dep| - bottle_dep = dep.to_formula.bottle - bottle_dep.fetch_tab(quiet: !args.debug?) - total_download_size += bottle_dep.bottle_size if bottle_dep.bottle_size - total_installed_size += bottle_dep.installed_size if bottle_dep.installed_size - end + next if f.deps.empty? + + f.recursive_dependencies.each do |dep| + bottle_dep = dep.to_formula.bottle + bottle_dep.fetch_tab(quiet: !args.debug?) + total_download_size += bottle_dep.bottle_size if bottle_dep.bottle_size + total_installed_size += bottle_dep.installed_size if bottle_dep.installed_size end end puts "Formulae: #{sized_formulae.join(", ")}\n\n" diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index b1049f7b24..8b906ec51c 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -48,10 +48,6 @@ module Homebrew "trying any other/default URLs.", boolean: true, }, - HOMEBREW_INSTALL_ASK: { - description: "If set, pass `--install-ask`to all formula install commands.", - boolean: true, - }, HOMEBREW_AUTO_UPDATE_SECS: { description: "Run `brew update` once every `$HOMEBREW_AUTO_UPDATE_SECS` seconds before some commands, " \ "e.g. `brew install`, `brew upgrade` and `brew tap`. Alternatively, " \ @@ -308,6 +304,10 @@ module Homebrew description: "Linux only: Set this value to a new enough `git` executable for Homebrew to use.", default: "git", }, + HOMEBREW_INSTALL_ASK: { + description: "If set, pass `--install-ask`to all formula install commands.", + boolean: true, + }, HOMEBREW_INSTALL_BADGE: { description: "Print this text before the installation summary of each successful build.", default_text: 'The "Beer Mug" emoji.',