Commit 3f03533e by UmanShahzad

Automate required plugin installation.

parent a8d2c5a5
# -*- mode: ruby -*-
# vi: set ft=ruby :
def install_plugins(plugins)
not_installed = []
plugins.each do |plugin|
unless Vagrant.has_plugin?(plugin)
not_installed << plugin
end
end
if not_installed.any?
puts "The following required plugins must be installed:"
puts "'#{not_installed.join("', '")}'"
print "Install? [y]/n: "
unless STDIN.gets.chomp == "n"
not_installed.each { |plugin| install_plugin(plugin) }
else
exit
end
$? ? continue : raise('Plugin installation failed, see errors above.')
end
end
def install_plugin(plugin)
system "vagrant plugin install #{plugin}"
end
# If plugins successfully installed, restart vagrant to detect changes.
def continue
exec "vagrant #{ARGV[0]}"
end
Vagrant.require_version ">= 1.8.7"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
require_relative '.vagrantplugins'
install_plugins(['vagrant-vbguest'])
VAGRANTFILE_API_VERSION = "2"
......
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
......
Vagrant.require_version ">= 1.8.7"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
require_relative '.vagrantplugins'
install_plugins(['vagrant-vbguest'])
VAGRANTFILE_API_VERSION = "2"
......
Vagrant.require_version ">= 1.8.7"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
require_relative '.vagrantplugins'
install_plugins(['vagrant-vbguest'])
VAGRANTFILE_API_VERSION = "2"
......
Vagrant.require_version ">= 1.8.7"
unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end
require_relative '.vagrantplugins'
install_plugins(['vagrant-vbguest'])
VAGRANTFILE_API_VERSION = "2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment