ledo/app/cmd/mode/select.go
2021-11-20 11:34:31 +01:00

29 lines
573 B
Go

package mode
import (
"github.com/urfave/cli/v2"
"ledo/app/modules/context"
"ledo/app/modules/interact"
)
var CmdModeSelect = cli.Command{
Name: "select",
Usage: "select run mode",
Description: `Select mode defined in project config file`,
ArgsUsage: "[<mode>]",
Action: RunSelectMode,
}
func RunSelectMode(cmd *cli.Context) error {
ctx := context.InitCommand(cmd)
if cmd.Args().Len() == 1 {
ctx.Mode.SetMode(cmd.Args().First())
return nil
}
// interact.SelectDockerHubTag("paramah/php")
interact.SelectMode(ctx, "")
return nil
}