lego/cmd/cmd_before.go
Fernandez Ludovic e7a90b9471 chore: migrate to go module (v3.0.0)
- chore: update dependencies: use version with go modules.
- chore: remove dep.
- chore: update backoff imports.
- chore: init go module.
- chore: update CI.
- chore: mod v3
- chore: update docker image.
2019-08-07 14:07:47 +02:00

23 lines
523 B
Go

package cmd
import (
"github.com/go-acme/lego/v3/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
}