mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-23 10:28:13 -05:00
24 lines
538 B
Go
24 lines
538 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/Yuzuki616/V2bX/node/controller/legoCmd/log"
|
|
"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
|
|
}
|