diff --git a/.codeclimate.yml b/.codeclimate.yml index a6456d0ee..f39e7cad7 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -18,7 +18,6 @@ exclude_paths: - "generators/*/templates/**/*" - "buffalo/cmd/filetests/*" - "examples/**/*" - - "grifts/**/*" - "vendor/**/*" - "**/*_test.go" - "*_test.go" diff --git a/Dockerfile.build b/Dockerfile.build index 16af7cd1a..0f83c15d6 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -32,7 +32,7 @@ RUN npm install -g --no-progress yarn \ # Install golangci RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0 # Installing buffalo binary -RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.15 | sh +RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.16 | sh RUN go get github.com/gobuffalo/buffalo-pop/v2 RUN buffalo version diff --git a/Dockerfile.slim.build b/Dockerfile.slim.build index 788b59d1a..4badb0dfe 100644 --- a/Dockerfile.slim.build +++ b/Dockerfile.slim.build @@ -17,7 +17,7 @@ RUN npm i -g --no-progress yarn \ && yarn config set yarn-offline-mirror-pruning true # Pulling docker binary from releases -RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.15 | sh +RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/buffalo@v0.16.16 | sh RUN go get github.com/gobuffalo/buffalo-pop/v2 RUN buffalo version diff --git a/buffalo/cmd/build.go b/buffalo/cmd/build.go index 1c663668e..9f75d89f7 100644 --- a/buffalo/cmd/build.go +++ b/buffalo/cmd/build.go @@ -130,9 +130,16 @@ func buildVersion(version string) string { run.Logger.Warnf("could not find %s; defaulting to version %s", vcs, version) return vcs } + var cmd *exec.Cmd switch vcs { case "git": + // If .git folder does not exist return default version + if stat, err := os.Stat(".git"); err != nil || !stat.IsDir() { + run.Logger.Warnf("could not find .git folder; defaulting to version %s", version) + return version + } + cmd = exec.Command("git", "rev-parse", "--short", "HEAD") case "bzr": cmd = exec.Command("bzr", "revno") diff --git a/grifts/tools.go b/grifts/tools.go deleted file mode 100644 index e8d989bdc..000000000 --- a/grifts/tools.go +++ /dev/null @@ -1,37 +0,0 @@ -package grifts - -import ( - "os" - "os/exec" - - "github.com/markbates/grift/grift" -) - -var _ = grift.Namespace("tools", func() { - - var run = func(args ...string) error { - cmd := exec.Command(args[0], args[1:]...) - cmd.Stdin = os.Stdin - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - return cmd.Run() - } - - var _ = grift.Add("install", func(c *grift.Context) error { - if _, err := exec.LookPath("golangci-lint"); err != nil { - if err := run("go", "get", "-v", "github.com/golangci/golangci-lint/cmd/golangci-lint"); err != nil { - return err - } - } - return nil - }) - - var _ = grift.Add("lint", func(c *grift.Context) error { - if err := grift.Run("tools:install", c); err != nil { - return err - } - - return run("golangci-lint", "run", "--fast", "--deadline=3m") - }) - -}) diff --git a/route_info.go b/route_info.go index b0d7f8fec..3309abbed 100644 --- a/route_info.go +++ b/route_info.go @@ -94,8 +94,6 @@ func (ri RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { a := ri.App c := a.newContext(ri, res, req) - defer c.Flash().persist(c.Session()) - payload := events.Payload{ "route": ri, "app": a, @@ -103,8 +101,8 @@ func (ri RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { } events.EmitPayload(EvtRouteStarted, payload) - err := a.Middleware.handler(ri)(c) + c.Flash().persist(c.Session()) if err != nil { status := http.StatusInternalServerError @@ -117,5 +115,6 @@ func (ri RouteInfo) ServeHTTP(res http.ResponseWriter, req *http.Request) { c.Response().WriteHeader(status) c.Response().Write([]byte(err.Error())) } + events.EmitPayload(EvtRouteFinished, payload) } diff --git a/runtime/version.go b/runtime/version.go index 52302ec37..9ec0a5fa2 100644 --- a/runtime/version.go +++ b/runtime/version.go @@ -1,4 +1,4 @@ package runtime // Version is the current version of the buffalo binary -var Version = "v0.16.15" +var Version = "v0.16.16"