2022-06-15 17:29:45 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"forge.cadoles.com/pcaseiro/templatefile/pkg/templater"
|
|
|
|
"github.com/alexflint/go-arg"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
var args struct {
|
|
|
|
Config string `arg:"-c,--config,env:CONFIG" help:"Configuration values file or directory path" default:"./data/config"`
|
|
|
|
TemplateDirectory string `arg:"-t,--template-dir,env:TEMPLATE_DIR" help:"Template directory path" default:"./data/templates"`
|
|
|
|
RootDirectory string `arg:"-r,--root-dir,env:ROOT_DIR" help:"Generate files with this root instead of /" default:"/"`
|
|
|
|
}
|
|
|
|
|
|
|
|
arg.MustParse(&args)
|
|
|
|
|
|
|
|
var hostConfig templater.TemplaterConfig
|
|
|
|
|
2022-07-01 14:56:41 +02:00
|
|
|
err := hostConfig.New(args.Config, args.TemplateDirectory, args.RootDirectory)
|
2022-06-15 17:29:45 +02:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
2022-07-01 14:56:41 +02:00
|
|
|
if err = hostConfig.ManageServices(); err != nil {
|
2022-06-15 17:29:45 +02:00
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|