Facebook watchman 文档描述了如何通过将 json 传递给命令来配置触发器,如下所示:
watchman --json-command < ./tasks/cmds/watchman-build-trigger.json
其中 watchman-build-trigger.json 包含以下内容:
[
"trigger",
"/Users/michaelprescott/Projects/neuro",
{
"name": "build",
"expression": [
"anyof",
[
"match",
"src/*.js",
"wholename"
],
[
"match",
"src/*.ts",
"wholename"
],
[
"match",
"src/*.html",
"wholename"
]
],
"command": [
"./tasks/cmds/build.sh"
]
}
]
但是,我正在尝试了解如何使用 .watchmanconfig 来设置手表和一组触发器,watchman watch-project
我有以下内容,但没有创建触发器。这可能吗?有没有人有 .watchmanconfig 的例子
{
"ignore_dirs": [
"node_modules"
],
"watched": [
{
"path": "/Users/michaelprescott/Projects/neuro",
"triggers": [
{
"command": [
"./tasks/cmds/build.sh"
],
"expression": [
"anyof",
[
"match",
"src/*.js",
"wholename"
],
[
"match",
"src/*.ts",
"wholename"
],
[
"match",
"src/*.html",
"wholename"
]
],
"name": "build"
}
]
}
]
}