From 8cbca4826e0f91b88acfa9f95e16812bd9b7ab67 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 31 Jul 2013 14:44:56 +0800 Subject: [PATCH] Watch current directory and ignore non-go files. --- run.go | 4 +++- watch.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/run.go b/run.go index eeb23cb..a5cace4 100644 --- a/run.go +++ b/run.go @@ -82,7 +82,9 @@ func runApp(cmd *Command, args []string) { paths = append(paths, path.Join(crupath, conf.DirStruct.Controllers), path.Join(crupath, conf.DirStruct.Models), - path.Join(crupath, conf.MainFiles.Main)) + path.Join(crupath, "./")) // Current path. + // Because monitor files has some issues, we watch current directory + // and ignore non-go files. paths = append(paths, conf.DirStruct.Others...) paths = append(paths, conf.MainFiles.Others...) diff --git a/watch.go b/watch.go index 48881b3..6207e05 100644 --- a/watch.go +++ b/watch.go @@ -139,7 +139,7 @@ func checkTMPFile(name string) bool { return false } -// checkIsGoFile return true if the name is HasSuffix go +// checkIsGoFile returns true if the name HasSuffix ".go". func checkIsGoFile(name string) bool { if strings.HasSuffix(name, ".go") { return true