-
-
Save dillonkrug/25ee1397510aa4dec1d7 to your computer and use it in GitHub Desktop.
forever watch file + multiple directories (using a watchIgnore glob)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
forever start --uid 'appname' -o app.log -e error.log -a -w --watchIgnore '!{app.js,{src,common,lib}/**}' app | |
# breaking it down: | |
# | |
# --uid 'appname' name the process so we can use `forever stop appname`. | |
# the quotes are necessary. | |
# | |
# -o app.log / -e error.log pipe stdout/stderr to files | |
# | |
# -a append to said files | |
# | |
# -w watch the current directory for changes | |
# | |
# --watchIgnore '!{app.js,{src,common,lib}/**}' tell forever to ignore changes from files that do NOT match | |
# the pattern `{app.js,{src,common,lib}/**}`. The `!` negates | |
# the glob, so we use the double negative to only watch | |
# specific files. This particular pattern results in the app | |
# restarting when app.js or any file within src/, common/, | |
# or lib/ is modified. | |
# | |
# app the main file to run: app.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment