local-server/cmd/dkl-local-server/data.go
2019-01-23 09:51:05 +13:00

22 lines
453 B
Go

package main
import (
"flag"
"path/filepath"
"novit.nc/direktil/pkg/localconfig"
)
var (
dataDir = flag.String("data", "/var/lib/direktil", "Data dir")
configFromDir = flag.String("config-from-dir", "", "Build configuration from this directory")
)
func configFilePath() string {
return filepath.Join(*dataDir, "config.yaml")
}
func readConfig() (config *localconfig.Config, err error) {
return localconfig.FromFile(configFilePath())
}