photoprism/internal/commands/config.go
Michael Mayer c7be7c43eb CLI: Refactor tests and config initialization
Signed-off-by: Michael Mayer <michael@photoprism.app>
2022-10-04 12:27:40 +02:00

15 lines
345 B
Go

package commands
import (
"github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/config"
"github.com/photoprism/photoprism/internal/service"
)
// InitConfig initializes the command config.
var InitConfig = func(ctx *cli.Context) (*config.Config, error) {
c := config.NewConfig(ctx)
service.SetConfig(c)
return c, c.Init()
}