package acme_sh import ( "fmt" "github.com/urfave/cli/v2" "gitea.micah.wiki/pandora/magic/config" ) func AcmeSH() *cli.Command { return &cli.Command{ Name: "acme.sh", Action: func(c *cli.Context) error { conf := config.Get() if len(conf.AcmeShs) == 0 { return fmt.Errorf("未找到acme.sh的配置") } current, err := ReadCurrentAcmeSh(c.Context, conf) if err != nil { return err } cmdPath, err := CheckAcmeSh(c.Context, conf, current) if err != nil { return err } newFlag, err := ReadIsNew(c.Context) if err != nil { return err } err = Run(c.Context, cmdPath, conf, current, newFlag) if err != nil { return err } _ = config.Save(conf) return nil }, } }