1
0

feat: initial daemon implementation

This commit is contained in:
2024-02-20 13:25:31 +00:00
parent 820208d079
commit 0314b5ca93
45 changed files with 2989 additions and 1041 deletions

View File

@ -26,7 +26,7 @@ import (
"code.dumpstack.io/tools/out-of-tree/cache"
"code.dumpstack.io/tools/out-of-tree/cmd"
"code.dumpstack.io/tools/out-of-tree/config"
"code.dumpstack.io/tools/out-of-tree/config/dotfiles"
"code.dumpstack.io/tools/out-of-tree/container"
"code.dumpstack.io/tools/out-of-tree/fs"
)
@ -44,6 +44,8 @@ type CLI struct {
Container cmd.ContainerCmd `cmd:"" help:"manage containers"`
Distro cmd.DistroCmd `cmd:"" help:"distro-related helpers"`
Daemon cmd.DaemonCmd `cmd:"" help:"run daemon"`
Version VersionFlag `name:"version" help:"print version information and quit"`
LogLevel LogLevelFlag `enum:"trace,debug,info,warn,error" default:"info"`
@ -132,7 +134,7 @@ func main() {
}
cmd.FileWriter = cmd.LevelWriter{Writer: &lumberjack.Logger{
Filename: config.File("logs/out-of-tree.log"),
Filename: dotfiles.File("logs/out-of-tree.log"),
},
Level: zerolog.TraceLevel,
}
@ -151,7 +153,7 @@ func main() {
log.Debug().Msgf("%v", buildInfo.Settings)
}
path := config.Dir()
path := dotfiles.Dir()
yes, err := fs.CaseInsensitive(path)
if err != nil {
log.Fatal().Err(err).Msg(path)