From d69bda7c1377058fd0525df0538b75717118336c Mon Sep 17 00:00:00 2001 From: Jens Egholm Date: Mon, 26 Nov 2018 19:11:43 +0100 Subject: [PATCH] entr: add page (#2613) --- pages/linux/entr.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pages/linux/entr.md diff --git a/pages/linux/entr.md b/pages/linux/entr.md new file mode 100644 index 0000000000..d4699c5de9 --- /dev/null +++ b/pages/linux/entr.md @@ -0,0 +1,19 @@ +# entr + +> Run arbitrary commands when files change. + +- Rebuild with `make` if any files in any subfolders change: + +`{{ag -l}} | entr {{make}}` + +- Rebuild and test with `make` if any `.c` source files in the current directory change: + +`{{ls *.c}} | entr {{'make && make test'}}` + +- Send a `SIGTERM` to any previously spawned ruby subprocesses before executing `ruby main.rb`: + +`{{ls *.rb}} | entr -r {{ruby main.rb}}` + +- Run a command with the changed file (`/_`) as an argument: + +`{{ls *.sql}} | entr {{psql -f}} /_`