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

Commit

Permalink
Because of the way we were making built binaries act as Buffalo binar…
Browse files Browse the repository at this point in the history
…ies (#1125)

is was possible for this to result in database drivers loading twice and
the app panicing.
  • Loading branch information
markbates authored Jun 22, 2018
1 parent 7dd791f commit 6ee9eb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion buffalo/cmd/build/build-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions buffalo/cmd/build/templates/main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"log"
"os"
"os/exec"
"time"
"strings"

"github.com/markbates/grift/grift"
"github.com/gobuffalo/buffalo/buffalo/cmd"
"github.com/gobuffalo/buffalo/runtime"
_ "<%= opts.PackagePkg %>/a"
_ "<%= opts.ActionsPkg %>"
Expand Down Expand Up @@ -64,7 +64,19 @@ func main() {
log.Fatal(err)
}
default:
cmd.Execute()
if _, err := exec.LookPath("buffalo"); err != nil {
if err != nil {
log.Fatal(err)
}
}
cmd := exec.Command("buffalo", args[1:]...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
if err != nil {
log.Fatal(err)
}
}
}

Expand Down

0 comments on commit 6ee9eb9

Please sign in to comment.