Is it possible to define what happens prior to vagrant destroy?
问题 I have a Vagrantfile that clones the required cookbook repos on vagrant up . The problem is, it also does this on vagrant destroy . Is there a way to define 'pre-construction' and 'pre-destruction' commands or does the Vagrantfile just get run in totality each time vagrant is invoked regardless of the parameters? 回答1: I don't know about a destroy hook, but you can detect first time and post-destoy actions in the Vagrantfile by checking the existence of the machine ID: File.exists?(".vagrant