2018-11-26 18:11:43 +00:00
|
|
|
# entr
|
|
|
|
|
|
|
|
> Run arbitrary commands when files change.
|
2021-04-17 16:15:37 +01:00
|
|
|
> More information: <https://manned.org/entr>.
|
2018-11-26 18:11:43 +00:00
|
|
|
|
2019-02-11 18:00:49 +00:00
|
|
|
- Rebuild with `make` if any file in any subdirectory changes:
|
2018-11-26 18:11:43 +00:00
|
|
|
|
|
|
|
`{{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}} /_`
|