watchexec

监视文件变化并运行命令,支持重启、过滤和忽略规则

补充说明

watchexec 监听目录/文件变化并执行命令,支持扩展名过滤、重启子进程、忽略规则和事件合并。它比 entr 更偏向“持续开发服务器/测试”场景。

常用示例

watchexec -e py -- pytest -q
watchexec -r -e go -- go run ./cmd/app
watchexec -w src -e rs -- cargo test
watchexec --ignore target -- make

易错点与排错