Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "Init", Short: "create clogrc/clog.yaml if missing", Long: `create missing clogrc/clog.yaml and clogrc/tmp-core.clog.yaml.`, Run: func(cmd *cobra.Command, args []string) { sample := "tpl/clog.yaml" core := "core.clog.yaml" dstFolder := "clogrc" _, err := os.Stat(dstFolder) if err != nil { slog.Warn("creating folder " + dstFolder) if err = os.MkdirAll(dstFolder, 0755); err != nil { slog.Error("failed to create folder " + dstFolder) os.Exit(1) } } dst := dstFolder + "/clog.yaml" _, err = os.Stat(dst) if err != nil { copy.Command.Run(cmd, []string{sample, dst}) } dst = "clogrc/tmp-core.clog.yaml" copy.Command.Run(cmd, []string{core, dst}) }, }
Command define the cobra settings for this command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.