2019-03-11 15:54:35 +00:00
|
|
|
package cmd // import "github.com/xenolf/lego/cmd"
|
2018-12-06 21:50:17 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
"github.com/xenolf/lego/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|