Skip to content

Commit b8e4884

Browse files
committed
update vagrant file
1 parent 37c62dc commit b8e4884

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Vagrantfile

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ VAGRANTFILE_API_VERSION = "2"
55
confDir = $confDir ||= File.expand_path("./config")
66

77
homesteadYamlPath = confDir + "/Homestead.yaml"
8+
homesteadJsonPath = confDir + "/Homestead.json"
89
afterScriptPath = confDir + "/after.sh"
910
aliasesPath = confDir + "/aliases"
1011

@@ -15,7 +16,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
1516
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
1617
end
1718

18-
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)), Vagrant.has_plugin?('vagrant-hostsupdater'))
19+
if File.exists? homesteadYamlPath then
20+
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)), Vagrant.has_plugin?('vagrant-hostsupdater'))
21+
elsif File.exists? homesteadJsonPath then
22+
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)), Vagrant.has_plugin?('vagrant-hostsupdater'))
23+
end
24+
1925

2026
if File.exists? afterScriptPath then
2127
config.vm.provision "shell", path: afterScriptPath

0 commit comments

Comments
 (0)