5

I am developing angular4 app using vagrant. I have installed vagrant-fsnotify plugin in order to notify file system changes to trigger hot build. The problem I have is how to run automatically vagrant fsnotify when vagrant booted?

gandra404
  • 5,727
  • 10
  • 52
  • 76

2 Answers2

2

Maybe vagrant-trigger can help you run this command everytime you boot your vm. An example should be like:

Vagrant.configure("2") do |config|
    # Your existing Vagrant configuration
     ...

     # start fsnotify on host after the guest starts
     config.trigger.after :up do
         run "vagrant fsnotify"
     end
end
alessandrocb
  • 677
  • 8
  • 21
1

Correct form of trigger statement is:

  # start fsnotify on host after the guest starts
  config.trigger.after :up do |trigger|
    trigger.run = {inline: "bash -c 'vagrant fsnotify > output.log 2>&1 &'"}
  end