From 908d2ba7929356f4379aab722e8678ba3ea31443 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Thu, 13 Mar 2014 10:11:00 -0500 Subject: [PATCH] Make interactive an installer mode --- Library/Homebrew/cmd/install.rb | 2 ++ Library/Homebrew/extend/ARGV.rb | 1 - Library/Homebrew/formula_installer.rb | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 8a13397b2d..2babedd26c 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -110,6 +110,8 @@ module Homebrew extend self fi.build_bottle = ARGV.build_bottle? fi.build_from_source = ARGV.build_from_source? fi.force_bottle = ARGV.force_bottle? + fi.interactive = ARGV.interactive? + fi.interactive &&= :git if ARGV.flag? "--git" fi.prelude fi.install fi.caveats diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index de1f428e02..2473d00d93 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -185,7 +185,6 @@ module HomebrewArgvExtension flags_to_clear = %w[ --debug -d --devel - --interactive -i --HEAD ] flags_to_clear.concat %w[--verbose -v] if quieter? diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index fff088e040..2bf1f979fa 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -24,7 +24,7 @@ class FormulaInstaller attr_accessor :options mode_attr_accessor :show_summary_heading, :show_header mode_attr_accessor :build_from_source, :build_bottle, :force_bottle - mode_attr_accessor :ignore_deps, :only_deps + mode_attr_accessor :ignore_deps, :only_deps, :interactive def initialize ff @f = ff @@ -34,6 +34,7 @@ class FormulaInstaller @build_from_source = false @build_bottle = false @force_bottle = false + @interactive = false @options = Options.new @@attempted ||= Set.new @@ -413,7 +414,7 @@ class FormulaInstaller end def build_time - @build_time ||= Time.now - @start_time unless ARGV.interactive? or @start_time.nil? + @build_time ||= Time.now - @start_time unless interactive? or @start_time.nil? end def sanitized_ARGV_options @@ -425,9 +426,9 @@ class FormulaInstaller args << "--bottle-arch=#{ARGV.bottle_arch}" if ARGV.bottle_arch end - if ARGV.interactive? + if interactive? args << "--interactive" - args << "--git" if ARGV.flag? "--git" + args << "--git" if interactive == :git end args << "--verbose" if ARGV.verbose?