2019-09-04 10:33:03 +02:00
|
|
|
package command
|
|
|
|
|
|
|
|
|
|
import (
|
2019-12-10 15:24:01 +01:00
|
|
|
"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"
|
2019-12-10 15:24:01 +01:00
|
|
|
"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
|
|
|
)
|
|
|
|
|
|
2019-12-10 15:24:01 +01:00
|
|
|
// PhoenixCommand is the entrypoint for the phoenix command.
|
|
|
|
|
func PhoenixCommand(cfg *config.Config) cli.Command {
|
|
|
|
|
return cli.Command{
|
2019-12-17 11:43:58 +01:00
|
|
|
Name: "phoenix",
|
|
|
|
|
Usage: "Start phoenix server",
|
|
|
|
|
Category: "Extensions",
|
2019-12-17 14:37:23 +01:00
|
|
|
Flags: flagset.ServerWithConfig(cfg.Phoenix),
|
2019-12-10 15:24:01 +01:00
|
|
|
Action: func(c *cli.Context) error {
|
2020-01-15 11:27:35 +01:00
|
|
|
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"), ",")
|
2020-01-15 11:27:35 +01:00
|
|
|
}
|
|
|
|
|
|
2019-12-10 15:24:01 +01:00
|
|
|
scfg := configurePhoenix(cfg)
|
|
|
|
|
|
|
|
|
|
return cli.HandleAction(
|
|
|
|
|
command.Server(scfg).Action,
|
|
|
|
|
c,
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-12-13 10:35:23 +01:00
|
|
|
func init() {
|
|
|
|
|
register.AddCommand(PhoenixCommand)
|
|
|
|
|
}
|