2022-06-01 13:35:41 -04:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2022-08-12 06:02:06 -04:00
|
|
|
"github.com/Yuzuki616/V2bX/app/legoCmd/log"
|
2022-06-01 13:35:41 -04:00
|
|
|
"github.com/urfave/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Before(ctx *cli.Context) error {
|
|
|
|
if ctx.GlobalString("path") == "" {
|
|
|
|
log.Panic("Could not determine current working directory. Please pass --path.")
|
|
|
|
}
|
|
|
|
|
|
|
|
err := createNonExistingFolder(ctx.GlobalString("path"))
|
|
|
|
if err != nil {
|
|
|
|
log.Panicf("Could not check/create path: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
if ctx.GlobalString("server") == "" {
|
|
|
|
log.Panic("Could not determine current working server. Please pass --server.")
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|