-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
37 lines (30 loc) · 805 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
*/
package main
import (
"fmt"
"github.com/Ezzy77/tempo/cmd"
"github.com/Ezzy77/tempo/config"
"github.com/Ezzy77/tempo/internal"
"github.com/spf13/viper"
)
func main() {
//godotenv.Load()
// create file to store weather api key locally
internal.CreateViperConfigFile()
// init viper configuration
viper.SetConfigName("tempoCLI_Config")
viper.SetConfigType("json")
viper.AddConfigPath("$HOME")
//viper.AutomaticEnv()
// Attempt to read the configuration file
if err := viper.ReadInConfig(); err != nil {
fmt.Println("Error reading config file:", err)
}
// Unmarshal the configuration into the Config struct
if err := viper.Unmarshal(&config.Config); err != nil {
fmt.Println("Error unmarshaling config:", err)
}
cmd.Execute()
}