generated from kedaya_haitao/template
26 lines
452 B
Go
26 lines
452 B
Go
|
package templates
|
||
|
|
||
|
import (
|
||
|
_ "embed"
|
||
|
"os"
|
||
|
"path/filepath"
|
||
|
)
|
||
|
|
||
|
var DefaultTemplate = "./template_meta.yaml"
|
||
|
|
||
|
//go:embed template_meta.yaml
|
||
|
var templateMeta string
|
||
|
|
||
|
func init() {
|
||
|
path := filepath.Join("./templates", DefaultTemplate)
|
||
|
_ = os.MkdirAll("./templates", 0755)
|
||
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||
|
f, _err := os.Create(path)
|
||
|
if _err != nil {
|
||
|
panic(_err)
|
||
|
}
|
||
|
defer f.Close()
|
||
|
_, err = f.WriteString(templateMeta)
|
||
|
}
|
||
|
}
|