feat: add wrapper to tern
so environment variables are passed to tern's config file
This commit is contained in:
parent
03c1025147
commit
5b7b08f733
2 changed files with 21 additions and 0 deletions
19
cmd/tools/terndotenv/main.go
Normal file
19
cmd/tools/terndotenv/main.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := godotenv.Load(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cmd := exec.Command("tern", "migrate", "--migrations", "./internal/store/pgstore/migrations", "--config", "./internal/store/pgstore/migrations/tern.conf")
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
2
go.mod
2
go.mod
|
|
@ -1,3 +1,5 @@
|
|||
module forgejo.home.viniciussouza.me/learning/go-react-server
|
||||
|
||||
go 1.22.2
|
||||
|
||||
require github.com/joho/godotenv v1.5.1
|
||||
|
|
|
|||
Loading…
Reference in a new issue