package main

import (
	"flag"
	"path/filepath"

	"novit.tech/direktil/pkg/localconfig"
)

var (
	dataDir  = flag.String("data", "/var/lib/direktil", "Data dir")
	keepDist = flag.Bool("keep-dist", false, "Keep dist files during cache cleanup (still removes assembled erofs)")
)

func configFilePath() string {
	return filepath.Join(*dataDir, "config.yaml")
}

func readConfig() (config *localconfig.Config, err error) {
	return localconfig.FromFile(configFilePath())
}
