27 lines
512 B
Go
27 lines
512 B
Go
package config
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
"git.metaunix.net/BitGoblin/adept/util"
|
|
)
|
|
|
|
func LoadConfig() {
|
|
viper.SetConfigName("adept")
|
|
viper.SetConfigType("toml")
|
|
viper.AddConfigPath("/etc/adept/")
|
|
viper.AddConfigPath(util.ResolveTilde("~/.config/"))
|
|
|
|
err := viper.ReadInConfig()
|
|
|
|
if err != nil {
|
|
log.Fatalf("Fatal error occurred while reading config: %s\n", err)
|
|
os.Exit(1)
|
|
}
|
|
|
|
viper.Set("transcoder.repository", util.ResolveTilde(viper.GetString("transcoder.repository")))
|
|
}
|