modifying files with brew style
This commit is contained in:
parent
f4d93e19b8
commit
99fad7797c
@ -307,9 +307,7 @@ module Homebrew
|
|||||||
Install.perform_preinstall_checks_once
|
Install.perform_preinstall_checks_once
|
||||||
Install.check_cc_argv(args.cc)
|
Install.check_cc_argv(args.cc)
|
||||||
|
|
||||||
if args.ask?
|
Install.ask(formulae, args: args) if args.ask?
|
||||||
Install.ask(formulae, args: args)
|
|
||||||
end
|
|
||||||
|
|
||||||
Install.install_formulae(
|
Install.install_formulae(
|
||||||
installed_formulae,
|
installed_formulae,
|
||||||
|
@ -132,9 +132,7 @@ module Homebrew
|
|||||||
Install.perform_preinstall_checks_once
|
Install.perform_preinstall_checks_once
|
||||||
|
|
||||||
# Main block: if asking the user is enabled, show dependency and size information.
|
# Main block: if asking the user is enabled, show dependency and size information.
|
||||||
if args.ask?
|
Install.ask(formulae, args: args) if args.ask?
|
||||||
Install.ask(formulae, args: args)
|
|
||||||
end
|
|
||||||
|
|
||||||
formulae.each do |formula|
|
formulae.each do |formula|
|
||||||
if formula.pinned?
|
if formula.pinned?
|
||||||
|
@ -222,9 +222,7 @@ module Homebrew
|
|||||||
Install.perform_preinstall_checks_once
|
Install.perform_preinstall_checks_once
|
||||||
|
|
||||||
# Main block: if asking the user is enabled, show dependency and size information.
|
# Main block: if asking the user is enabled, show dependency and size information.
|
||||||
if args.ask?
|
Install.ask(formulae_to_install, args: args) if args.ask?
|
||||||
Install.ask(formulae_to_install, args: args)
|
|
||||||
end
|
|
||||||
|
|
||||||
Upgrade.upgrade_formulae(
|
Upgrade.upgrade_formulae(
|
||||||
formulae_to_install,
|
formulae_to_install,
|
||||||
|
@ -327,7 +327,6 @@ module Homebrew
|
|||||||
puts formula_names.join(" ")
|
puts formula_names.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Main block: if asking the user is enabled, show dependency and size information.
|
# Main block: if asking the user is enabled, show dependency and size information.
|
||||||
def ask(formulae, args:)
|
def ask(formulae, args:)
|
||||||
ohai "Looking for bottles..."
|
ohai "Looking for bottles..."
|
||||||
@ -336,7 +335,8 @@ module Homebrew
|
|||||||
sizes = compute_total_sizes(sized_formulae, debug: args.debug?)
|
sizes = compute_total_sizes(sized_formulae, debug: args.debug?)
|
||||||
|
|
||||||
puts "#{::Utils.pluralize("Formul", sized_formulae.count, plural: "ae",
|
puts "#{::Utils.pluralize("Formul", sized_formulae.count, plural: "ae",
|
||||||
singular: "a")} (#{sized_formulae.count}): #{sized_formulae.join(", ")}\n\n"
|
singular: "a")} (#{sized_formulae.count}): \
|
||||||
|
#{sized_formulae.join(", ")}\n\n"
|
||||||
puts "Download Size: #{disk_usage_readable(sizes[:download])}"
|
puts "Download Size: #{disk_usage_readable(sizes[:download])}"
|
||||||
puts "Install Size: #{disk_usage_readable(sizes[:installed])}"
|
puts "Install Size: #{disk_usage_readable(sizes[:installed])}"
|
||||||
puts "Net Install Size: #{disk_usage_readable(sizes[:net])}" if sizes[:net] != 0
|
puts "Net Install Size: #{disk_usage_readable(sizes[:net])}" if sizes[:net] != 0
|
||||||
@ -381,7 +381,6 @@ module Homebrew
|
|||||||
Upgrade.install_formula(formula_installer, upgrade:)
|
Upgrade.install_formula(formula_installer, upgrade:)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def ask_input
|
def ask_input
|
||||||
ohai "Do you want to proceed with the installation? [Y/y/yes/N/n]"
|
ohai "Do you want to proceed with the installation? [Y/y/yes/N/n]"
|
||||||
accepted_inputs = %w[y yes]
|
accepted_inputs = %w[y yes]
|
||||||
|
@ -89,10 +89,9 @@ RSpec.describe Homebrew::Cmd::InstallCmd do
|
|||||||
it "installs with asking for user prompts without installed dependent checks", :integration_test do
|
it "installs with asking for user prompts without installed dependent checks", :integration_test do
|
||||||
setup_test_formula "testball1"
|
setup_test_formula "testball1"
|
||||||
|
|
||||||
expect {
|
expect do
|
||||||
brew "install", "--ask", "testball1"
|
brew "install", "--ask", "testball1"
|
||||||
}.to output(/.*Formula\s*\(1\):\s*testball1.*/
|
end.to output(/.*Formula\s*\(1\):\s*testball1.*/).to_stdout.and not_to_output.to_stderr
|
||||||
).to_stdout.and not_to_output.to_stderr
|
|
||||||
|
|
||||||
expect(HOMEBREW_CELLAR/"testball1/0.1/bin/test").to be_a_file
|
expect(HOMEBREW_CELLAR/"testball1/0.1/bin/test").to be_a_file
|
||||||
end
|
end
|
||||||
@ -108,8 +107,7 @@ RSpec.describe Homebrew::Cmd::InstallCmd do
|
|||||||
setup_test_formula "testball5", <<~RUBY
|
setup_test_formula "testball5", <<~RUBY
|
||||||
depends_on "testball4"
|
depends_on "testball4"
|
||||||
RUBY
|
RUBY
|
||||||
setup_test_formula "testball4", <<~RUBY
|
setup_test_formula "testball4", ""
|
||||||
RUBY
|
|
||||||
setup_test_formula "hiop"
|
setup_test_formula "hiop"
|
||||||
setup_test_formula "build"
|
setup_test_formula "build"
|
||||||
|
|
||||||
@ -120,8 +118,8 @@ RSpec.describe Homebrew::Cmd::InstallCmd do
|
|||||||
|
|
||||||
expect {
|
expect {
|
||||||
brew "install", "--ask", "testball1"
|
brew "install", "--ask", "testball1"
|
||||||
}.to output(/.*Formulae\s*\(3\):\s*testball1\s*,?\s*testball5\s*,?\s*testball4.*/
|
}.to output(/.*Formulae\s*\(3\):\s*testball1\s*,?\s*testball5\s*,?\s*testball4.*/).to_stdout
|
||||||
).to_stdout.and not_to_output.to_stderr
|
.and not_to_output.to_stderr
|
||||||
|
|
||||||
expect(HOMEBREW_CELLAR/"testball1/0.1/bin/test").to be_a_file
|
expect(HOMEBREW_CELLAR/"testball1/0.1/bin/test").to be_a_file
|
||||||
expect(HOMEBREW_CELLAR/"testball4/0.1/bin/testball4").to be_a_file
|
expect(HOMEBREW_CELLAR/"testball4/0.1/bin/testball4").to be_a_file
|
||||||
|
@ -146,7 +146,7 @@ RSpec.shared_context "integration test" do # rubocop:disable RSpec/ContextWordin
|
|||||||
program_name = "test"
|
program_name = "test"
|
||||||
end
|
end
|
||||||
|
|
||||||
tarball_name = "#{prefix}-0.1#{'-linux' if OS.linux?}.tbz"
|
tarball_name = "#{prefix}-0.1#{"-linux" if OS.linux?}.tbz"
|
||||||
tarball = TEST_FIXTURE_DIR / "tarballs/#{tarball_name}"
|
tarball = TEST_FIXTURE_DIR / "tarballs/#{tarball_name}"
|
||||||
|
|
||||||
content = <<~RUBY
|
content = <<~RUBY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user