Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Commit

Permalink
ensure the dep installs the correct version of buffalo
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Jul 20, 2017
1 parent 0ec3057 commit 118965e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions generators/newapp/new.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package newapp

import (
"fmt"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -36,8 +37,7 @@ func (a *App) Generator(data makr.Data) (*makr.Generator, error) {
g.Add(makr.NewCommand(makr.GoGet("golang.org/x/tools/cmd/goimports", "-u")))
g.Add(makr.NewCommand(makr.GoInstall("golang.org/x/tools/cmd/goimports")))
if !a.SkipDep {
g.Add(makr.NewCommand(makr.GoGet("github.com/golang/dep", "-u")))
g.Add(makr.NewCommand(makr.GoInstall("github.com/golang/dep")))
g.Add(makr.NewCommand(makr.GoGet("github.com/golang/dep/cmd/dep", "-u")))
}
g.Add(makr.NewCommand(makr.GoGet("github.com/motemen/gore", "-u")))
g.Add(makr.NewCommand(makr.GoInstall("github.com/motemen/gore")))
Expand Down Expand Up @@ -111,6 +111,13 @@ func (a *App) Generator(data makr.Data) (*makr.Generator, error) {
g.Add(dg)
}
g.Add(makr.NewCommand(a.goGet()))
if !a.SkipDep {
if v, ok := data["version"].(string); ok {
if v != "development" {
g.Add(makr.NewCommand(exec.Command("dep", "ensure", fmt.Sprintf("github.com/gobuffalo/buffalo@%s", v))))
}
}
}

return g, nil
}
Expand Down

0 comments on commit 118965e

Please sign in to comment.