mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-08-03 21:15:32 +02:00
Create fswatch.md (#1005)
* Create fswatch.md * Update fswatch.md * Update fswatch.md * Update fswatch.md * Update fswatch.md * Update fswatch.md * Update fswatch.md * Update fswatch.md * Update fswatch.md
This commit is contained in:
parent
04f25d3684
commit
3babe7cebc
1 changed files with 19 additions and 0 deletions
19
pages/common/fswatch.md
Normal file
19
pages/common/fswatch.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# fswatch
|
||||
|
||||
> A cross-platform file change monitor.
|
||||
|
||||
- Run a bash command on file creation, update or deletion:
|
||||
|
||||
`fswatch -0 {{path/to/file}} | xargs -0 {{bash_command}}`
|
||||
|
||||
- Watch one or more files and/or directories:
|
||||
|
||||
`fswatch -0 {{path/to/file}} {{path/to/directory}} {{path/to/another_directory/**/*.js}} | xargs -0 {{bash_command}}`
|
||||
|
||||
- Use `{}` in your bash command as a placeholder for the absolute path to the changed file:
|
||||
|
||||
`fswatch -0 {{path/to/directory}} | xargs -0 -I {} {{bash_command}}`
|
||||
|
||||
- Filter by event type, eg. Updated, Deleted or Created:
|
||||
|
||||
`fswatch -0 --event {{Updated}} {{path/to/directory}} | xargs -0 {{bash_command}}`
|
Loading…
Add table
Reference in a new issue