2025-03-14 21:59:59 -06:00
|
|
|
# reflex
|
|
|
|
|
|
|
|
|
|
> Watch a directory and rerun a command when certain files change.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://github.com/cespare/reflex#usage>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Rebuild with `make` if any file changes:
|
|
|
|
|
|
|
|
|
|
`reflex make`
|
|
|
|
|
|
|
|
|
|
- Compile and run Go application if any `.go` file changes:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`reflex {{[-r|--regex]}} '{{\.go$}}' {{go run .}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Ignore a directory when watching for changes:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`reflex {{[-G|--inverse-regex]}} '{{^dir/}}' {{command}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Run command when reflex starts and restarts on file changes:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`reflex {{[-s|--start-service]}} true {{command}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Substitute the filename that changed in:
|
|
|
|
|
|
|
|
|
|
`reflex -- echo {}`
|