From dc7162b57d3f1e97b45e39a17e62baca4a86436d Mon Sep 17 00:00:00 2001 From: dengsgo Date: Sun, 5 Jan 2020 14:44:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 +++++++++++++ README_EN.md | 13 +++++++++++++ raw.go | 27 +++++++++++++-------------- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ad19676..ec63b00 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,19 @@ command: # 如果不需要该特性,设置为 0 delayMillSecond: 2000 + # 特殊指令 + # 可以通过预定义的指令来控制 command 的行为,指令可以有多个 + # exec-when-start fileboy启动就绪后,自动执行一次 'exec' 定义的命令 + # should-finish 触发执行 'exec' 时(C),如果上一次的命令(L)未退出(还在执行),会等待 L 退出,直到有明确 exit code 才会开始执行本次命令。 + # 在等待 L 退出时,又有新事件触发了命令执行(N),则 C 执行取消,只会保留最后一次的 N 执行 + # ignore-stdout 执行 'exec' 产生的 stdout 会被丢弃 + # ignore-warn fileboy 自身的 warn 信息会被丢弃 + # ignore-info fileboy 自身的 info 信息会被丢弃 + # ignore-exec-error 执行 'exec' 出错仍继续执行下面的命令而不退出 + instruction: + #- should-finish + #- exec-when-start + # 通知器 notifier: # 文件更改会向该 url 发送请求(POST 一段 json 文本数据) diff --git a/README_EN.md b/README_EN.md index 49d9c1d..57f6258 100644 --- a/README_EN.md +++ b/README_EN.md @@ -127,6 +127,19 @@ command: # If this feature is not required, set to 0 delayMillSecond: 2000 + # 特殊指令 + # 可以通过预定义的指令来控制 command 的行为,指令可以有多个 + # exec-when-start fileboy启动就绪后,自动执行一次 'exec' 定义的命令 + # should-finish 触发执行 'exec' 时(C),如果上一次的命令(L)未退出(还在执行),会等待 L 退出,直到有明确 exit code 才会开始执行本次命令。 + # 在等待 L 退出时,又有新事件触发了命令执行(N),则 C 执行取消,只会保留最后一次的 N 执行 + # ignore-stdout 执行 'exec' 产生的 stdout 会被丢弃 + # ignore-warn fileboy 自身的 warn 信息会被丢弃 + # ignore-info fileboy 自身的 info 信息会被丢弃 + # ignore-exec-error 执行 'exec' 出错仍继续执行下面的命令而不退出 + instruction: + #- should-finish + #- exec-when-start + notifier: # file changes send requests to the URL (POST JSON text data) # the timing of triggering the request is consistent with executing the command command diff --git a/raw.go b/raw.go index 89de000..51c1694 100644 --- a/raw.go +++ b/raw.go @@ -48,20 +48,6 @@ monitor: # 命令 command: - # 特殊指令 //TODO next release support - # 可以通过预定义的指令来控制 command 的行为,指令可以有多个 - # exec-when-start fileboy启动就绪后,自动执行一次 'exec' 定义的命令 - # should-finish 触发执行 'exec' 时(C),如果上一次的命令(L)未退出(还在执行),会等待 L 退出,直到有明确 exit code 才会开始执行本次命令。 - # 在等待 L 退出时,又有新事件触发了命令执行(N),则 C 执行取消,只会保留最后一次的 N 执行 - # ignore-stdout 执行 'exec' 产生的 stdout 会被丢弃 - # ignore-warn fileboy 自身的 warn 信息会被丢弃 - # ignore-info fileboy 自身的 info 信息会被丢弃 - # ignore-exec-error 执行 'exec' 出错仍继续执行下面的命令而不退出 - # limit-memory-256M 限制内存占用,超过 256M 'exec' 会被强制停止。格式 limit-memory-xxM - instruction: - #- should-finish - #- exec-when-start - # 监听的文件有更改会执行的命令 # 可以有多条命令,会依次执行 # 如有多条命令,每条命令都会等待上一条命令执行完毕后才会执行 @@ -83,6 +69,19 @@ command: # 如果不需要该特性,设置为 0 delayMillSecond: 2000 + # 特殊指令 + # 可以通过预定义的指令来控制 command 的行为,指令可以有多个 + # exec-when-start fileboy启动就绪后,自动执行一次 'exec' 定义的命令 + # should-finish 触发执行 'exec' 时(C),如果上一次的命令(L)未退出(还在执行),会等待 L 退出,直到有明确 exit code 才会开始执行本次命令。 + # 在等待 L 退出时,又有新事件触发了命令执行(N),则 C 执行取消,只会保留最后一次的 N 执行 + # ignore-stdout 执行 'exec' 产生的 stdout 会被丢弃 + # ignore-warn fileboy 自身的 warn 信息会被丢弃 + # ignore-info fileboy 自身的 info 信息会被丢弃 + # ignore-exec-error 执行 'exec' 出错仍继续执行下面的命令而不退出 + instruction: + #- should-finish + #- exec-when-start + # 通知器 notifier: # 文件更改会向该 url 发送请求(POST 一段 json 文本数据)