Vagrant allows you to run "vagrant ..." from any directory, and it will search upwards to find the nearest Vagrantfile. I've written my trigger scripts assuming that the current working directory is the same directory as my Vagrantfile, but that appears to not be the case. Here's my workaround:
config.trigger.before [:reload, :up, :provision], stdout: true do
Dir.chdir '..' while !File.exist?('Vagrantfile')
...
end
Vagrant allows you to run "vagrant ..." from any directory, and it will search upwards to find the nearest
Vagrantfile
. I've written my trigger scripts assuming that the current working directory is the same directory as myVagrantfile
, but that appears to not be the case. Here's my workaround: