Last active
August 29, 2015 14:20
-
-
Save adrianwebb/61c22b5e8badb0d94073 to your computer and use it in GitHub Desktop.
Clean and update Vagrant gems for current user.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
vagrant_home_dir="$HOME/.vagrant.d" | |
/usr/bin/env ruby <<-EORUBY | |
require 'json' | |
require 'fileutils' | |
puts 'Loading current Vagrant plugin data' | |
plugin_data = JSON.parse(File.read("$vagrant_home_dir/plugins.json")) | |
puts 'Removing existing Vagrant plugins' | |
FileUtils.rm_rf('$vagrant_home_dir') | |
plugin_data['installed'].each do |gem_name, info| | |
system("vagrant plugin install #{gem_name}") | |
end | |
EORUBY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment