mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-11-14 19:01:35 +03:00
20 lines
519 B
Markdown
20 lines
519 B
Markdown
# entr
|
|
|
|
> Run arbitrary commands when files change.
|
|
|
|
- Rebuild with `make` if any file in any subdirectory changes:
|
|
|
|
`{{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}} /_`
|