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

Fixes panicking built binaries #1125

Merged
merged 1 commit into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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