#79 fixed
This commit is contained in:
parent
cc88af49cd
commit
9f2f05f0dd
|
@ -153,6 +153,9 @@ func (p *Project) goInstall() (string, error) {
|
||||||
|
|
||||||
// GoTools is used for run go methods such as fmt, test, generate...
|
// GoTools is used for run go methods such as fmt, test, generate...
|
||||||
func (p *Project) goTools(dir string, name string, cmd ...string) (string, error) {
|
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
|
var out, stderr bytes.Buffer
|
||||||
build := exec.Command(name, cmd...)
|
build := exec.Command(name, cmd...)
|
||||||
build.Dir = dir
|
build.Dir = dir
|
||||||
|
|
|
@ -161,7 +161,7 @@ func (p *Project) watch(watcher watcher) error {
|
||||||
wd, _ := os.Getwd()
|
wd, _ := os.Getwd()
|
||||||
walk := func(path string, info os.FileInfo, err error) error {
|
walk := func(path string, info os.FileInfo, err error) error {
|
||||||
if !p.ignore(path) {
|
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 {
|
if p.Watcher.Preview {
|
||||||
log.Println(p.pname(p.Name, 1), ":", path)
|
log.Println(p.pname(p.Name, 1), ":", path)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue