Very quiet mode for development

This commit is contained in:
Mitchell Hashimoto 2014-04-20 20:34:54 -07:00
parent 036c0b74d4
commit ce08a37d5f
3 changed files with 11 additions and 3 deletions

View File

@ -156,7 +156,7 @@ begin
logger.debug("Creating Vagrant environment")
env = Vagrant::Environment.new(opts)
if !Vagrant.in_installer?
if !Vagrant.in_installer? && !Vagrant.very_quiet?
# If we're not in the installer, warn.
env.ui.warn(I18n.t("vagrant.general.not_in_installer") + "\n", prefix: false)
end

View File

@ -2,9 +2,11 @@
# initializes the Bundler context so that Vagrant and its associated plugins
# can load properly, and then execs out into Vagrant again.
require_relative "shared_helpers"
if defined?(Bundler)
require "bundler/shared_helpers"
if Bundler::SharedHelpers.in_bundle?
if Bundler::SharedHelpers.in_bundle? && !Vagrant.very_quiet?
puts "Vagrant appears to be running in a Bundler environment. Your "
puts "existing Gemfile will be used. Vagrant will not auto-load any plugins"
puts "installed with `vagrant plugin`. Vagrant will autoload any plugins in"
@ -16,7 +18,6 @@ end
require_relative "bundler"
require_relative "plugin/manager"
require_relative "shared_helpers"
plugins = Vagrant::Plugin::Manager.instance.installed_plugins
Vagrant::Bundler.instance.init!(plugins)

View File

@ -32,6 +32,13 @@ module Vagrant
!ENV["VAGRANT_NO_PLUGINS"]
end
# Whether or not super quiet mode is enabled. This is ill-advised.
#
# @return [Boolean]
def self.very_quiet?
!!ENV["VAGRANT_I_KNOW_WHAT_IM_DOING_PLEASE_BE_QUIET"]
end
# Returns the URL prefix to the server.
#
# @return [String]