Created
April 3, 2015 19:22
-
-
Save bretdavidson/1a769920d3a90fac4c5d to your computer and use it in GitHub Desktop.
Vagrant config stuff
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
# Before Vagrant.configure() | |
required_plugins = %w(vagrant-timezone) | |
required_plugins.each do |plugin| | |
need_restart = false | |
unless Vagrant.has_plugin? plugin | |
puts "Installing" + plugin + "..." | |
system "vagrant plugin install #{plugin}" | |
need_restart = true | |
end | |
exec "vagrant #{ARGV.join(' ')}" if need_restart | |
end | |
# INSIDE Of Vagrant.configure() | |
if RUBY_PLATFORM["darwin"] | |
time_zone=`sudo systemsetup -gettimezone|cut -d':' -f2| tr -d '[[:space:]]'` | |
elsif RUBY_PLATFORM["linux"] | |
time_zone=`cat /etc/timezone| tr -d '[[:space:]]'` | |
else | |
# FIXME: Handle windows | |
# time_zone=`tzutil /g` | |
end | |
if Vagrant.has_plugin?("vagrant-timezone") | |
config.timezone.value = time_zone | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment