From 354849895ac6621c2cf4a0cafae3e277c63b9077 Mon Sep 17 00:00:00 2001 From: thibhero Date: Fri, 7 Feb 2025 14:39:22 -0500 Subject: [PATCH] changing `ask_input` function to lambda --- Library/Homebrew/cmd/install.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 8abb00a84c..12dbc82b60 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -180,9 +180,7 @@ module Homebrew odisabled "brew install --env", "`env :std` in specific formula files" end - sig { returns(NilClass) } - - def ask_input + ask_input = lambda { ohai "Do you want to proceed with the installation? [Y/y/yes/N/n]" accepted_inputs = %w[y yes] declined_inputs = %w[n no] @@ -197,7 +195,7 @@ module Homebrew puts "Invalid input. Please enter 'Y', 'y', or 'yes' to proceed, or 'N' to abort." end end - end + } args.named.each do |name| if (tap_with_name = Tap.with_formula_name(name)) @@ -351,7 +349,7 @@ module Homebrew puts "Formulae: #{sized_formulae.join(", ")}\n\n" puts "Download Size: #{disk_usage_readable(total_download_size)}" if total_download_size puts "Install Size: #{disk_usage_readable(total_installed_size)}\n" if total_installed_size - ask_input + ask_input.call end Install.install_formulae(