diggerhq / digger

Digger is an open source IaC orchestration tool. Digger allows you to run IaC in your existing CI pipeline ⚡️
https://digger.dev
Apache License 2.0
2.86k stars 133 forks source link

The binary doesn't run without being in the source directory with templates as relative path #1332

Closed ZIJ closed 4 months ago

ZIJ commented 5 months ago

Proposed solution: use go embed

Reported by user T. G.

evanstachowiak commented 4 months ago

For anyone else googling this, this is the error I received:

func1 (5 handlers)
panic: html/template: pattern matches no files: `templates/*.tmpl`

goroutine 1 [running]:
html/template.Must(...)
    /home/runner/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.0.linux-amd64/src/html/template/template.go:368
github.com/gin-gonic/gin.(*Engine).LoadHTMLGlob(0xc00104e4e0, {0x2000f09, 0x10})
    /home/runner/go/pkg/mod/github.com/gin-gonic/gin@v1.9.1/gin.go:255 +0x2f7
main.main()
    /home/runner/work/digger/digger/backend/main.go:73 +0x549

The fix for now is to put the templates dir into the current working directory where digger api command is run.