29 lines
471 B
Go
29 lines
471 B
Go
package main
|
|
|
|
import (
|
|
"git.gorlug.de/code/ersteller/starter/create"
|
|
"log"
|
|
"path"
|
|
|
|
"entgo.io/ent/entc"
|
|
"entgo.io/ent/entc/gen"
|
|
)
|
|
|
|
func main() {
|
|
log.Println("starter generate schema")
|
|
thisDir := create.GetPathToThisDir()
|
|
paginationPath := path.Join(thisDir, "../../schema/ent/pagination_query.tmpl")
|
|
|
|
must(entc.Generate(
|
|
"./ent/schema",
|
|
&gen.Config{},
|
|
entc.TemplateFiles(paginationPath),
|
|
))
|
|
}
|
|
|
|
func must(err error) {
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|