diff --git a/cmd/pack.go b/cmd/pack.go index 819b66ff..078c31cb 100644 --- a/cmd/pack.go +++ b/cmd/pack.go @@ -23,7 +23,6 @@ var packCmd = &cobra.Command{ Long: L("Package the application into a single file"), Run: func(cmd *cobra.Command, args []string) { - config.Init() cfg := config.Conf output, err := filepath.Abs(filepath.Join(cfg.Root, "dist")) if err != nil { diff --git a/cmd/root.go b/cmd/root.go index 045c29f2..7d0f7a49 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -145,7 +145,6 @@ func Execute() { // Boot 设定配置 func Boot() { - config.Init() root := config.Conf.Root if appPath != "" { r, err := filepath.Abs(appPath) diff --git a/config/config.go b/config/config.go index 87ac8d65..28d95892 100644 --- a/config/config.go +++ b/config/config.go @@ -25,6 +25,10 @@ var LogOutput *os.File // 日志文件 // DSLExtensions the dsl file Extensions var DSLExtensions = []string{"*.yao", "*.json", "*.jsonc"} +func init() { + Init() +} + // Init setting func Init() {