27 lines
642 B
Go
27 lines
642 B
Go
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"`
|
|
}
|
|
|
|
arg.MustParse(&args)
|
|
|
|
var hostConfig templater.TemplaterConfig
|
|
|
|
err := hostConfig.New(args.Config, args.TemplateDirectory)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if err = hostConfig.ManageServices(); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|