Files
ocis/pkg/command/phoenix.go
T

36 lines
907 B
Go
Raw Normal View History

2019-09-04 10:33:03 +02:00
package command
import (
"github.com/micro/cli"
"github.com/owncloud/ocis-phoenix/pkg/command"
"github.com/owncloud/ocis-phoenix/pkg/flagset"
2020-01-15 14:20:21 +01:00
"github.com/owncloud/ocis-pkg/conversions"
"github.com/owncloud/ocis/pkg/config"
2019-12-13 10:35:23 +01:00
"github.com/owncloud/ocis/pkg/register"
2019-09-04 10:33:03 +02:00
)
// PhoenixCommand is the entrypoint for the phoenix command.
func PhoenixCommand(cfg *config.Config) cli.Command {
return cli.Command{
Name: "phoenix",
Usage: "Start phoenix server",
Category: "Extensions",
2019-12-17 14:37:23 +01:00
Flags: flagset.ServerWithConfig(cfg.Phoenix),
Action: func(c *cli.Context) error {
if c.String("web-config-apps") != "" {
2020-01-15 14:20:21 +01:00
cfg.Phoenix.Phoenix.Config.Apps = conversions.StringToSliceString(c.String("web-config-apps"), ",")
}
scfg := configurePhoenix(cfg)
return cli.HandleAction(
command.Server(scfg).Action,
c,
)
},
}
}
2019-12-13 10:35:23 +01:00
func init() {
register.AddCommand(PhoenixCommand)
}