jsonc.go 475 B

1234567891011121314151617181920212223242526
  1. package cmd
  2. import (
  3. "gadmin/internal/jsonc"
  4. "os"
  5. "github.com/sirupsen/logrus"
  6. "github.com/spf13/cobra"
  7. )
  8. var jsonCmd = &cobra.Command{
  9. Use: "jsonc",
  10. Short: "根据传入版本号,更新gadmin服务所需的json配置文件",
  11. Run: func(cmd *cobra.Command, args []string) {
  12. logrus.Info("jsonc called")
  13. version := os.Getenv("JSON_VERSION")
  14. if len(args) > 0 {
  15. version = args[0]
  16. }
  17. jsonc.Run(version)
  18. },
  19. }
  20. func init() {
  21. rootCmd.AddCommand(jsonCmd)
  22. }