diff --git a/buffalo/cmd/info.go b/buffalo/cmd/info.go index b2cbb420b..84e0c4f08 100644 --- a/buffalo/cmd/info.go +++ b/buffalo/cmd/info.go @@ -4,7 +4,9 @@ import ( "fmt" "os" "os/exec" + "reflect" + "github.com/gobuffalo/buffalo/meta" "github.com/gobuffalo/envy" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -19,6 +21,15 @@ var infoCmd = &cobra.Command{ bb.WriteString(fmt.Sprintf("### Buffalo Version\n%s\n", Version)) + bb.WriteString("\n### App Information\n") + app := meta.New(".") + rv := reflect.ValueOf(app) + rt := rv.Type() + for i := 0; i < rt.NumField(); i++ { + f := rt.Field(i) + bb.WriteString(fmt.Sprintf("%s=%v\n", f.Name, rv.FieldByName(f.Name).Interface())) + } + bb.WriteString("\n### Go Version\n") c := exec.Command(envy.Get("GO_BIN", "go"), "version") c.Stdout = bb @@ -53,6 +64,26 @@ var infoCmd = &cobra.Command{ bb.WriteString("NPM Not Found\n") } + bb.WriteString("\n### Yarn Version\n") + if _, err := exec.LookPath("yarn"); err == nil { + c = exec.Command("yarn", "--version") + c.Stdout = bb + c.Stderr = bb + c.Run() + } else { + bb.WriteString("Yarn Not Found\n") + } + + bb.WriteString("\n### Dep Version\n") + if _, err := exec.LookPath("dep"); err == nil { + c = exec.Command("dep", "version") + c.Stdout = bb + c.Stderr = bb + c.Run() + } else { + bb.WriteString("dep Not Found\n") + } + bb.WriteString("\n### Dep Status\n") if _, err := exec.LookPath("dep"); err == nil { c = exec.Command("dep", "status") diff --git a/meta/app.go b/meta/app.go index e9a1befec..1032d2033 100644 --- a/meta/app.go +++ b/meta/app.go @@ -32,10 +32,10 @@ type App struct { // New App based on the details found at the provided root path func New(root string) App { pwd, _ := os.Getwd() - pp := packagePath(root) if root == "." { root = pwd } + pp := packagePath(root) app := App{ Pwd: pwd,