1
0
mirror of https://github.com/go-acme/lego.git synced 2025-01-08 09:14:51 +02:00
lego/cmd/cmd_before.go

24 lines
515 B
Go
Raw Normal View History

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