Advertisement
Guest User

Untitled

a guest
Dec 28th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.98 KB | None | 0 0
  1. require 'json'
  2. require 'yaml'
  3.  
  4. VAGRANTFILE_API_VERSION = "2"
  5. confDir = $confDir ||= File.expand_path("~/.homestead")
  6.  
  7. homesteadYamlPath = confDir + "/Homestead.yaml"
  8. homesteadJsonPath = confDir + "/Homestead.json"
  9. afterScriptPath = confDir + "/after.sh"
  10. aliasesPath = confDir + "/aliases"
  11.  
  12. require File.expand_path(File.dirname(__FILE__) + '/scripts/homestead.rb')
  13.  
  14. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  15.     #config.vm.synced_folder '.', '/vagrant', disabled: true
  16.     if File.exists? aliasesPath then
  17.         config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
  18.     end
  19.  
  20.     if File.exists? homesteadYamlPath then
  21.         Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
  22.     elsif File.exists? homesteadJsonPath then
  23.         Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
  24.     end
  25.  
  26.     if File.exists? afterScriptPath then
  27.         config.vm.provision "shell", path: afterScriptPath
  28.     end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement