From 0c5cd4a468d261ec5d93685dcac5e80df86ecbd3 Mon Sep 17 00:00:00 2001 From: dengsgo Date: Tue, 8 Jan 2019 15:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20dirs=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fileboy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fileboy.go b/fileboy.go index ce94e70..cb5f293 100644 --- a/fileboy.go +++ b/fileboy.go @@ -9,6 +9,7 @@ import ( "math/rand" "os" "path" + "strings" "time" ) @@ -79,6 +80,9 @@ func addWatcher() { if len(darr) < 1 || len(darr) > 2 { log.Fatalln("filegirl section monitor dirs is error. ", cfg.Monitor.IncludeDirs[i]) } + if strings.HasPrefix(darr[0], "/") { + log.Fatalln("dirs must be relative paths ! err path:", cfg.Monitor.IncludeDirs[i]) + } if darr[0] == "." { if len(darr) == 2 && darr[1] == "*" { dirs = make([]string, 0)