diff --git a/ci-build.sh b/ci-build.sh index cd60129..8bc9774 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -30,9 +30,9 @@ build() { echo "Getting packr2 and building embedded files" go get -u github.com/gobuffalo/packr/v2/packr2 - packr2 echo "Building project" + go generate ${SRCFILES} go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES} if [[ ! -z $DRONE_TAG ]] diff --git a/cmd/qrz/qrz.go b/cmd/qrz/qrz.go index 1f05335..4ad5efa 100644 --- a/cmd/qrz/qrz.go +++ b/cmd/qrz/qrz.go @@ -1,13 +1,15 @@ +//go:generate packr2 -v + package main import ( "log" - _ "git.paulbsd.com/paulbsd/qrz/packrd" "git.paulbsd.com/paulbsd/qrz/src/config" "git.paulbsd.com/paulbsd/qrz/src/database" "git.paulbsd.com/paulbsd/qrz/src/qrz" "git.paulbsd.com/paulbsd/qrz/src/qrzws" + "github.com/gobuffalo/packr/v2" _ "github.com/lib/pq" ) @@ -18,6 +20,8 @@ func main() { cfg.GetConfig() cfg.Version = version + PackrGen() + err := database.Initialize(&cfg) if err != nil { log.Fatalln(err) @@ -34,3 +38,8 @@ func main() { log.Fatalln(err) } } + +func PackrGen() { + packr.New("static", "../../static") + packr.New("templates", "../../templates") +} diff --git a/packr.go b/packr.go deleted file mode 100644 index e1c58fd..0000000 --- a/packr.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - "github.com/gobuffalo/packr/v2" -) - -func main() { - packr.New("static", "./static") - packr.New("templates", "./templates") -} diff --git a/src/qrzws/main.go b/src/qrzws/main.go index 334656a..bd94f47 100644 --- a/src/qrzws/main.go +++ b/src/qrzws/main.go @@ -1,3 +1,5 @@ +//go:generate packr2 -v + package qrzws import ( diff --git a/src/static/main.go b/src/static/main.go index 463bb9e..1111c7d 100644 --- a/src/static/main.go +++ b/src/static/main.go @@ -1,3 +1,5 @@ +//go:generate packr2 -v + package static import ( diff --git a/src/templates/main.go b/src/templates/main.go index 6de1773..e9a8599 100644 --- a/src/templates/main.go +++ b/src/templates/main.go @@ -1,3 +1,5 @@ +//go:generate packr2 -v + package templates import (