2025-05-10 03:49:27 +10:00
|
|
|
# watchman
|
|
|
|
|
|
|
|
> A service that watches files, and triggers actions when changes occur.
|
|
|
|
> More information: <https://facebook.github.io/watchman/docs/cli-options>.
|
|
|
|
|
2025-05-24 03:46:14 +10:00
|
|
|
- Infer the root directory of the project containing the specified directory, and watch its files and sub-folders for changes:
|
2025-05-10 03:49:27 +10:00
|
|
|
|
2025-05-24 03:46:14 +10:00
|
|
|
`watchman watch-project {{path/to/directory}}`
|
2025-05-10 03:49:27 +10:00
|
|
|
|
|
|
|
- Add a trigger to run a command when files with a specified filename pattern in a watched directory change:
|
|
|
|
|
|
|
|
`watchman -- trigger {{path/to/watched_directory}} {{trigger_name}} '{{pattern}}' -- {{command}}`
|
|
|
|
|
|
|
|
- List all watched directories:
|
|
|
|
|
|
|
|
`watchman watch-list`
|
|
|
|
|
2025-05-24 03:46:14 +10:00
|
|
|
- Delete a watch on a directory and its associated triggers:
|
2025-05-10 03:49:27 +10:00
|
|
|
|
|
|
|
`watchman watch-del {{path/to/watched_directory}}`
|
|
|
|
|
2025-05-24 03:46:14 +10:00
|
|
|
- Delete all watched directories and triggers:
|
|
|
|
|
|
|
|
`watchman watch-del-all`
|
|
|
|
|
2025-05-10 03:49:27 +10:00
|
|
|
- List all triggers on a watched directory:
|
|
|
|
|
|
|
|
`watchman trigger-list {{path/to/watched_directory}}`
|
|
|
|
|
|
|
|
- Delete a trigger from a watched directory:
|
|
|
|
|
|
|
|
`watchman trigger-del {{path/to/watched_directory}} {{trigger_name}}`
|
2025-05-24 03:46:14 +10:00
|
|
|
|
|
|
|
- Temporarily stop `watchman`, until the next time you call a `watchman` command:
|
|
|
|
|
|
|
|
`watchman shutdown-server`
|