<% if (homestead.format == 'json') { -%> require 'json' <% } else { -%> require 'yaml' <% } -%> VAGRANTFILE_API_VERSION ||= "2" confDir = $confDir ||= File.expand_path("vendor/laravel/homestead", File.dirname(__FILE__)) <% if (homestead.format == 'json') { -%> settingsFilePath = "vagrant/homestead.json" <% } else { -%> settingsFilePath = "vagrant/homestead.yml" <% } -%> provisionScriptPath = "vagrant/provision.sh" aliasesPath = "vagrant/aliases" require File.expand_path(confDir + "/scripts/homestead.rb") Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| if File.exists? aliasesPath then config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases" end if File.exists? settingsFilePath then <% if (homestead.format == 'json') { -%> settings = JSON.parse(File.read(settingsFilePath)) <% } else { -%> settings = YAML::load(File.read(settingsFilePath)) <% } -%> else abort("Configuration file \"" + settingsFilePath + "\" not found") end if Vagrant.has_plugin?("vagrant-hostsupdater") then config.hostsupdater.aliases = settings["hostaliases"].kind_of?(Array) ? settings["hostaliases"] : [] end Homestead.configure(config, settings) if File.exists? provisionScriptPath then config.vm.provision "shell", path: provisionScriptPath end end