From a5eca83ccae8cbd3412a43b742e3e73e0c20de0e Mon Sep 17 00:00:00 2001 From: WnndGws Date: Wed, 27 May 2020 19:47:48 +0000 Subject: [PATCH] watchexec: add page (#4061) --- pages/common/watchexec.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/common/watchexec.md diff --git a/pages/common/watchexec.md b/pages/common/watchexec.md new file mode 100644 index 000000000..297f623b6 --- /dev/null +++ b/pages/common/watchexec.md @@ -0,0 +1,20 @@ +# watchexec + +> Run arbitrary commands when files change. +> More information: . + +- Call `ls -la` when any file in the current directory changes: + +`watchexec -- {{ls -la}}` + +- Run `make` when any JavaScript, CSS and HTML files in the current directory change: + +`watchexec --exts {{js,css,html}} make` + +- Run `make` when any file in the `lib` or `src` subdirectories change: + +`watchexec --watch {{lib}} --watch {{src}} {{make}}` + +- Call/restart `my_server` when any file in the current directory change, sending `SIGKILL` to stop the child process: + +`watchexec --restart --signal {{SIGKILL}} {{my_server}}`