diff --git a/CHANGELOG.md b/CHANGELOG.md index 367215a..0e496e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +### Release v1.12 + +2019.12.18 + +- 增加 自定义监控事件(write/rename/remove/create/chmod) +- 增加 {{event}} 事件名占位符 / event 网络通知字段 +- 增加 文件(夹)变更动态添加/删除监听(beta) +- 优化 init 命令,如果已有`filegirl.yaml`现在提示错误,不会自动覆盖 +- 优化 日志输出缓冲,可以通过 >> 将fileboy自身输出日志重定向到文件 +- 修复 始终默认监听主目录的问题 +- 升级 底层依赖 +- PR Makefile 的支持 @jason-gao + + ### Release v1.10 2019.06.04 diff --git a/README.md b/README.md index c2981df..98b58f6 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ go version 1.13 ### 下载二进制文件 -Github: [download v1.10](https://github.com/dengsgo/fileboy/releases) -Gitee: [dowmload v1.10](https://gitee.com/dengsgo/fileboy/releases) +Github: [download v1.12](https://github.com/dengsgo/fileboy/releases) +Gitee: [dowmload v1.12](https://gitee.com/dengsgo/fileboy/releases) 下载已经编译好的对应平台二进制文件,重命名为`fileboy`, 加入系统 Path 中即可。 @@ -137,7 +137,7 @@ notifier: # 请求超时 15 秒 # POST 格式: # Content-Type: application/json;charset=UTF-8 - # User-Agent: FileBoy Net Notifier v1.10 + # User-Agent: FileBoy Net Notifier v1.12 # Body: {"project_folder":"/project/path","file":"main.go","changed":1576567861913824940,"ext":".go","event":"write"} # 例: http://example.com/notifier/fileboy-listener # 不启用通知,请留空 "" diff --git a/README_EN.md b/README_EN.md index 8644d3d..49d9c1d 100644 --- a/README_EN.md +++ b/README_EN.md @@ -32,8 +32,8 @@ go version 1.13 ### BINARIES -Github: [download v1.10](https://github.com/dengsgo/fileboy/releases) -Gitee: [dowmload v1.10](https://gitee.com/dengsgo/fileboy/releases) +Github: [download v1.12](https://github.com/dengsgo/fileboy/releases) +Gitee: [dowmload v1.12](https://gitee.com/dengsgo/fileboy/releases) Download the compiled binary file of the corresponding platform, rename it `fileboy`, and add it to the system Path. @@ -133,7 +133,7 @@ notifier: # timeout 15 second # POST : # Content-Type: application/json;charset=UTF-8 - # User-Agent: FileBoy Net Notifier v1.10 + # User-Agent: FileBoy Net Notifier v1.12 # Body: {"project_folder":"/project/path","file":"main.go","changed":1576567861913824940,"ext":".go","event":"write"} # e.g: http://example.com/notifier/fileboy-listener # no notice is enabled. Please leave it blank. "" diff --git a/notifer.go b/notifer.go index ae2e0af..656008a 100644 --- a/notifer.go +++ b/notifer.go @@ -62,7 +62,7 @@ func (n *NetNotifier) dispatch(params *postParams) { return } req.Header.Set("Content-Type", "application/json;charset=UTF-8") - req.Header.Set("User-Agent", "FileBoy Net Notifier v1.10") + req.Header.Set("User-Agent", "FileBoy Net Notifier v1.12") resp, err := client.Do(req) if err != nil { log.Println(PreError, "notifier call failed. err:", err) diff --git a/raw.go b/raw.go index eaafbd1..5f669e1 100644 --- a/raw.go +++ b/raw.go @@ -55,6 +55,7 @@ command: # 支持变量占位符,运行命令时会替换成实际值: # {{file}} 文件名(如 a.txt 、test/test2/a.go) # {{ext}} 文件后缀(如 .go) + # {{event}} 事件(上面的events, 如 write) # {{changed}} 文件更新的本地时间戳(纳秒,如 1537326690523046400) # 变量占位符使用示例:cp {{file}} /root/sync -rf 、 myCommand --{{ext}} {{changed}} exec: @@ -62,7 +63,7 @@ command: - go env # 文件变更后命令在xx毫秒后才会执行,单位为毫秒 - # 一个变更事件(A)如果在定义的延迟时间(t)内,又有新的文件变更事件(B),那么A会取消执行。 + # 一个变更事件(A)如果在定义的延迟时间(t)内, 又有新的文件变更事件(B), 那么A会取消执行。 # B及以后的事件均依次类推,直到事件Z在t内没有新事件产生,Z 会执行 # 合理设置延迟时间,将有效减少冗余和重复任务的执行 # 如果不需要该特性,设置为 0 @@ -75,8 +76,8 @@ notifier: # 请求超时 15 秒 # POST 格式: # Content-Type: application/json;charset=UTF-8 - # User-Agent: FileBoy Net Notifier v1.10 - # Body: {"project_folder":"/watcher-dirs","file":"test.go","changed":1546421173070433800,"ext":".go"} + # User-Agent: FileBoy Net Notifier v1.12 + # Body: {"project_folder":"/project/path","file":"main.go","changed":1576567861913824940,"ext":".go","event":"write"} # 例: http://example.com/notifier/fileboy-listener # 不启用通知,请留空 "" callUrl: "" @@ -118,13 +119,13 @@ var logo = ` _____ _ | | _____ ____) ) | | | |___| | | ___) | | | | | ___) | __ (| | | |\_____/ | | _| |_| |_____| |_____| |__) ) |___| | ___ -|_| (_____)_______)_______)______/ \_____/ (___) V1.10 +|_| (_____)_______)_______)______/ \_____/ (___) V1.12 ` var statement = `Dengsgo [dengsgo@gmail.com] Open Source with MIT License` var versionDesc = ` - Version fileboy: v1.10 filegirl: v` + strconv.Itoa(Version) + ` -Released 2019.6.4 + Version fileboy: v1.12 filegirl: v` + strconv.Itoa(Version) + ` +Released 2019.12.18 Licence MIT Author dengsgo [dengsgo@gmail.com] Website https://github.com/dengsgo/fileboy