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

Commit

Permalink
Ensure no buffalo deps are updated using buffalo new (#1236)
Browse files Browse the repository at this point in the history
* Install needed packages if necessary, but don't update them.
* When using dep, skip go get pop and its dependencies, use dep instead.

Fixes #482
  • Loading branch information
stanislas-m authored Aug 21, 2018
1 parent 25e2069 commit 5aa5ea1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions generators/newapp/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (a Generator) Run(root string, data makr.Data) error {
}

if _, err := exec.LookPath("goimports"); err != nil {
g.Add(makr.NewCommand(makr.GoGet("golang.org/x/tools/cmd/goimports", "-u")))
g.Add(makr.NewCommand(makr.GoGet("golang.org/x/tools/cmd/goimports")))
}

if a.WithDep {
Expand All @@ -43,7 +43,7 @@ func (a Generator) Run(root string, data makr.Data) error {
// This step needs to be in a separate generator, because goGet() exec.Command
// checks if the executable exists (so before running the generator).
gg := makr.New()
gg.Add(makr.NewCommand(makr.GoGet("github.com/golang/dep/cmd/dep", "-u")))
gg.Add(makr.NewCommand(makr.GoGet("github.com/golang/dep/cmd/dep")))
if err := gg.Run(root, data); err != nil {
return errors.WithStack(err)
}
Expand Down
8 changes: 5 additions & 3 deletions generators/soda/soda.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ func (sd Generator) Run(root string, data makr.Data) error {
f.Should = should
g.Add(f)

c := makr.NewCommand(makr.GoGet("github.com/gobuffalo/pop/..."))
c.Should = should
g.Add(c)
if !sd.App.WithDep {
c := makr.NewCommand(makr.GoGet("github.com/gobuffalo/pop/..."))
c.Should = should
g.Add(c)
}

g.Add(&makr.Func{
Should: should,
Expand Down

0 comments on commit 5aa5ea1

Please sign in to comment.