33
44# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
55VAGRANTFILE_API_VERSION = "2"
6+ MADSCIENCE_MINIMUM_GEM_VERSION = "0.0.25"
67
78require_relative "config/madscience_config.rb"
89
@@ -12,6 +13,16 @@ UNSET_VARS = %w(_ORIGINAL_GEM_PATH GEM_PATH GEM_HOME GEM_ROOT
1213 BUNDLE_BIN_PATH BUNDLE_GEMFILE RUBYLIB RUBYOPT
1314 RUBY_ENGINE RUBY_ROOT RUBY_VERSION )
1415
16+ cloned_by = File . join ( File . dirname ( __FILE__ ) , ".cloned_by" )
17+ if File . exist? ( cloned_by )
18+ ver = File . read ( cloned_by ) . split ( "\n " ) [ 0 ] . scan ( /\d +\. \d +\. \d +/ ) [ 0 ]
19+ if !ver || ver < MADSCIENCE_MINIMUM_GEM_VERSION
20+ puts "Warning: make sure you've set up this machine with at least MadScience #{ MADSCIENCE_MINIMUM_GEM_VERSION } !"
21+ end
22+ else
23+ puts "Warning: no .cloned_by file, can't determine MadScience gem version!"
24+ end
25+
1526Vagrant . configure ( VAGRANTFILE_API_VERSION ) do |config |
1627 # All Vagrant configuration is done here. The most common configuration
1728 # options are documented and commented below. For a complete reference,
@@ -40,7 +51,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
4051 # Workaround: avoids 'stdin: is not a tty' error.
4152 config . ssh . shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
4253
43- # First, locate this user's SSH key
54+ # Locate this user's SSH key
4455 home_dir = ENV [ 'HOME' ] || ENV [ 'userdir' ] || "/home/#{ ENV [ 'USER' ] } "
4556 ssh_dir = File . join ( home_dir , ".ssh" )
4657
0 commit comments