I'm dissecting Laravel Homestead's configuration. In the Vagrantfile is the following line:
confDir = $confDir ||= File.expand_path("vendor/laravel/homestead")
$confDir
is mentioned nowhere before that line. Its value is nil and I wonder what would give it a value? Something from the CLI?
A Vagrantfile is just a ruby script. In ruby, a dollar sign variable is a global variable.
Now, this still doesn't make much sense when just looking at the homestead Vagrantfile alone. However, that may not be the only Vagrantfile in use. As described in the vagrant documentation here, under "LOAD ORDER AND MERGING", Vagrantfiles are loaded in the following order:
The homestead Vagrantfile is the file loaded in step 3. If you have a Vagrantfile in step 1 or 2 that sets the $confDir
variable, then the homestead Vagrantfile will pick that up and use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With