diff options
author | AlabĂȘ Duarte <aduarte@thoughtworks.com> | 2015-02-23 21:03:47 -0300 |
---|---|---|
committer | Neissi Torres Lima <neissi.lima@gmail.com> | 2015-03-23 18:39:55 -0300 |
commit | b7f311b46d878da77e6424acbae38ad2f19e6c9d (patch) | |
tree | f62f4dabd7bc5c0428e6a9b3ceba3bf453b83215 /Vagrantfile | |
parent | 7a4c5c0c99d5b4f3f14c029d0da600f6a6bd83ad (diff) |
Insteads of raising out, it installs the plugin if it is not installed as the first thing
Diffstat (limited to 'Vagrantfile')
-rw-r--r-- | Vagrantfile | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Vagrantfile b/Vagrantfile index 7ded6b89..c3f3b08a 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -4,6 +4,17 @@ # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" +new_plugin_installed = false +unless Vagrant.has_plugin?('vagrant-vbguest') + plugin = 'vagrant-vbguest' + puts "Missing plugin #{plugin}, installing..." + + `vagrant plugin install #{plugin}` + + new_plugin_installed = true +end +exec "vagrant #{ARGV.join' '}" if new_plugin_installed + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # All Vagrant configuration is done here. The most common configuration # options are documented and commented below. For a complete reference, @@ -18,10 +29,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "leap-wheezy" - unless Vagrant.has_plugin?("vagrant-vbguest") - raise 'plugin vagrant-vbguest is not installed! Please run `vagrant plugin install vagrant-vbguest`' - end - config.vbguest.auto_update = false config.vm.define "source", primary: true do |source| |