[fix] config init

This commit is contained in:
Max 2023-04-24 17:58:06 +08:00
parent ce4aaf667f
commit 48415db96d
3 changed files with 4 additions and 2 deletions

View file

@ -23,7 +23,6 @@ var packCmd = &cobra.Command{
Long: L("Package the application into a single file"), Long: L("Package the application into a single file"),
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
config.Init()
cfg := config.Conf cfg := config.Conf
output, err := filepath.Abs(filepath.Join(cfg.Root, "dist")) output, err := filepath.Abs(filepath.Join(cfg.Root, "dist"))
if err != nil { if err != nil {

View file

@ -145,7 +145,6 @@ func Execute() {
// Boot 设定配置 // Boot 设定配置
func Boot() { func Boot() {
config.Init()
root := config.Conf.Root root := config.Conf.Root
if appPath != "" { if appPath != "" {
r, err := filepath.Abs(appPath) r, err := filepath.Abs(appPath)

View file

@ -25,6 +25,10 @@ var LogOutput *os.File // 日志文件
// DSLExtensions the dsl file Extensions // DSLExtensions the dsl file Extensions
var DSLExtensions = []string{"*.yao", "*.json", "*.jsonc"} var DSLExtensions = []string{"*.yao", "*.json", "*.jsonc"}
func init() {
Init()
}
// Init setting // Init setting
func Init() { func Init() {