diff --git a/CHANGELOG.md b/CHANGELOG.md index e6e2a0c11..a96c5b309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ IMPROVEMENTS: - Don't load `vagrant plugin` installed plugins when in a Bundler environment. This happens during plugin development. This will make Vagrant errors much quieter when developing plugins. + - Vagrant will detect Bundler environments, make assumptions that you're + developing plugins, and will quiet its error output a bit. BUG FIXES: diff --git a/bin/vagrant b/bin/vagrant index e9dc99bff..895e2c160 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -52,8 +52,23 @@ begin logger.debug("Creating Vagrant environment") env = Vagrant::Environment.new(opts) - # If we're not in the installer, warn. - env.ui.warn(I18n.t("vagrant.general.not_in_installer")) if !Vagrant.in_installer? + if !Vagrant.in_installer? + warned = false + + # If we're in a bundler environment, we assume it is for plugin + # development and will let the user know that. + if defined?(Bundler) + require 'bundler/shared_helpers' + if Bundler::SharedHelpers.in_bundle? + env.ui.warn(I18n.t("vagrant.general.in_bundler")) + env.ui.warn("") + warned = true + end + end + + # If we're not in the installer, warn. + env.ui.warn(I18n.t("vagrant.general.not_in_installer")) if !warned + end begin # Execute the CLI interface, and exit with the proper error code diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 79598496b..91e273c9e 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -18,6 +18,11 @@ en: Old: %{old} New: %{new} + in_bundler: |- + You appear to be running Vagrant in a Bundler environment. Because + Vagrant should be run within installers (outside of Bundler), Vagrant + will assume that you're developing plugins and will change its behavior + in certain ways to better assist plugin development. not_in_installer: |- You appear to be running Vagrant outside of the official installers. Note that the installers are what ensure that Vagrant has all required