diff --git a/watcher/exec.go b/watcher/exec.go index d619bc9..692148c 100644 --- a/watcher/exec.go +++ b/watcher/exec.go @@ -153,6 +153,9 @@ func (p *Project) goInstall() (string, error) { // GoTools is used for run go methods such as fmt, test, generate... func (p *Project) goTools(dir string, name string, cmd ...string) (string, error) { + if s := filepath.Ext(dir); s != "" && s != ".go" { + return "", nil + } var out, stderr bytes.Buffer build := exec.Command(name, cmd...) build.Dir = dir diff --git a/watcher/watcher.go b/watcher/watcher.go index 87ba22d..56818a0 100644 --- a/watcher/watcher.go +++ b/watcher/watcher.go @@ -161,7 +161,7 @@ func (p *Project) watch(watcher watcher) error { wd, _ := os.Getwd() walk := func(path string, info os.FileInfo, err error) error { if !p.ignore(path) { - if (info.IsDir() && len(filepath.Ext(path)) == 0 && !strings.HasPrefix(path, ".")) && !strings.Contains(path, "/.") || (inArray(filepath.Ext(path), p.Watcher.Exts)) { + if ((info.IsDir() && len(filepath.Ext(path)) == 0 && !strings.HasPrefix(path, ".")) && !strings.Contains(path, "/.")) || (inArray(filepath.Ext(path), p.Watcher.Exts)) { if p.Watcher.Preview { log.Println(p.pname(p.Name, 1), ":", path) }