diff --git a/cmd/here/main.go b/cmd/here/main.go index 6ee7352..6694d33 100644 --- a/cmd/here/main.go +++ b/cmd/here/main.go @@ -6,7 +6,7 @@ import ( "os" "os/exec" - "github.com/gobuffalo/here" + "github.com/gobuffalo/here/there" ) func main() { @@ -21,12 +21,10 @@ func main() { args = append(args, pwd) } - h := here.New() - - fn := h.Dir + fn := there.Dir switch args[0] { case "pkg": - fn = h.Package + fn = there.Package args = args[1:] if len(args) == 0 { log.Fatalf("you must pass at least one package name") diff --git a/dir.go b/dir.go index 9fb3e35..ecd75dd 100644 --- a/dir.go +++ b/dir.go @@ -69,6 +69,9 @@ func fromNonGoDir(dir string) (Info, error) { b, err := run("go", "list", "-json", "-m") if err != nil { + if nonGoDirRx.MatchString(err.Error()) { + return i, nil + } return i, err } diff --git a/here.go b/here.go index cec1d76..e1d5765 100644 --- a/here.go +++ b/here.go @@ -54,4 +54,4 @@ func (h Here) cache(p string, fn func(string) (Info, error)) (Info, error) { return i, nil } -var nonGoDirRx = regexp.MustCompile(`cannot find main|go help modules|go: |build .:|no Go files|can't load package`) +var nonGoDirRx = regexp.MustCompile(`cannot find main|go help modules|go: |build .:|no Go files|can't load package|not using modules`)