1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-04 19:45:28 +02:00
lego/cmd/cmd_before.go
2019-03-11 17:56:48 +01:00

24 lines
520 B
Go

package cmd
import (
"github.com/go-acme/lego/log"
"github.com/urfave/cli"
)
func Before(ctx *cli.Context) error {
if len(ctx.GlobalString("path")) == 0 {
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)
}
if len(ctx.GlobalString("server")) == 0 {
log.Fatal("Could not determine current working server. Please pass --server.")
}
return nil
}