From 4417f80cdb248f5dde7ef3929a41b203d76a7ad1 Mon Sep 17 00:00:00 2001 From: Matthias Fasching Date: Wed, 7 Jul 2021 15:07:25 +0200 Subject: [PATCH] Run go mod tidy when initializing a new project (#2124) * Run go mod tidy when initializing a new project * Use Go 1.15 instead of 1.14 during workflows --- .github/workflows/release.yml | 4 ++-- buffalo/cmd/new.go | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6783fca49..bb4e9a03a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.14 + name: Set up Go 1.15 uses: actions/setup-go@v1 with: - go-version: 1.14 + go-version: 1.15 id: go - name: Checkout Code diff --git a/buffalo/cmd/new.go b/buffalo/cmd/new.go index b8573bc84..2ccebf045 100644 --- a/buffalo/cmd/new.go +++ b/buffalo/cmd/new.go @@ -201,6 +201,12 @@ var newCmd = &cobra.Command{ } run.WithGroup(gg) + g := genny.New() + g.Command(exec.Command("go", "mod", "tidy")) + if err := run.With(g); err != nil { + return nil + } + if err := run.WithNew(gogen.Fmt(app.Root)); err != nil { return err }