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?
Asked
Active
Viewed 777 times
5

gandra404
- 5,727
- 10
- 52
- 76
-
Did you ever find a workablesolution to this? – dave_slash_null Aug 14 '17 at 13:29
2 Answers
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
-
The plugin `vagrant-trigger` has been merged into Vagrant so there's no need to install explicitly, just use the configuration as suggested. – David Ferenczy Rogožan Oct 30 '19 at 20:51
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

Віталій Боринський
- 41
- 5