lego/cmd/cmd_before.go

24 lines
519 B
Go
Raw Permalink Normal View History

2019-03-11 16:56:48 +00:00
package cmd
import (
2020-09-02 01:20:01 +00:00
"github.com/go-acme/lego/v4/log"
"github.com/urfave/cli/v2"
)
func Before(ctx *cli.Context) error {
if ctx.String(flgPath) == "" {
log.Fatalf("Could not determine current working directory. Please pass --%s.", flgPath)
}
err := createNonExistingFolder(ctx.String(flgPath))
if err != nil {
log.Fatalf("Could not check/create path: %v", err)
}
if ctx.String(flgServer) == "" {
log.Fatalf("Could not determine current working server. Please pass --%s.", flgServer)
}
return nil
}