2019-03-11 16:56:48 +00:00
|
|
|
package cmd
|
2018-12-06 21:50:17 +00:00
|
|
|
|
|
|
|
import (
|
2020-09-02 01:20:01 +00:00
|
|
|
"github.com/go-acme/lego/v4/log"
|
2018-12-06 21:50:17 +00:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Before(ctx *cli.Context) error {
|
2021-03-04 19:16:59 +00:00
|
|
|
if ctx.GlobalString("path") == "" {
|
2018-12-06 21:50:17 +00:00
|
|
|
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 19:16:59 +00:00
|
|
|
if ctx.GlobalString("server") == "" {
|
2018-12-06 21:50:17 +00:00
|
|
|
log.Fatal("Could not determine current working server. Please pass --server.")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|