blasphem/cmd/blas/main.go

35 lines
600 B
Go
Raw Permalink Normal View History

2022-09-25 22:16:21 -04:00
package main
import (
2022-10-25 19:03:23 -04:00
"os"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
2022-09-25 22:16:21 -04:00
"dynatron.me/x/blasphem/internal/common"
"dynatron.me/x/blasphem/pkg/cmd/serve"
"dynatron.me/x/blasphem/pkg/config"
"github.com/spf13/cobra"
)
func main() {
2022-10-25 19:03:23 -04:00
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
2022-09-25 22:16:21 -04:00
rootCmd := cobra.Command{
Use: common.AppName,
}
config, err := config.ReadConfig()
if err != nil {
2022-10-25 19:03:23 -04:00
log.Fatal().Err(err).Msg("Config read failed")
2022-09-25 22:16:21 -04:00
}
rootCmd.AddCommand(serve.Command(config))
err = rootCmd.Execute()
if err != nil {
2022-10-25 19:03:23 -04:00
log.Fatal().Err(err).Msg("Dying")
2022-09-25 22:16:21 -04:00
}
}