Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EmbedCmd = &cobra.Command{ Use: "embed", Short: `Embed config file`, Run: func(cmd *cobra.Command, args []string) { if len(args) <= 0 { logrus.Errorln("Please specify the config file path") os.Exit(1) } ok, err := checkEmbed() if err != nil { logrus.Errorln("check magic error", err) os.Exit(1) } if update && ok { err = updateEmbed(args[0], os.Args[0]) if err != nil { logrus.Errorln(err) os.Exit(1) } logrus.Infoln("Update embed config file success") os.Exit(0) } if ok { logrus.Warnln("config file has been embedded") os.Exit(1) } copyBin, err := copyBin(os.Args[0]) if err != nil { logrus.Errorln("create copy binary file error:", err.Error()) os.Exit(1) } err = embed(args[0], copyBin) if err != nil { logrus.Errorln(err) os.Exit(1) } logrus.Infoln("Embed config file success") }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.