chore: change to viper

This commit is contained in:
Slug-Boi
2025-04-19 20:48:06 +02:00
parent b542561de1
commit c1b9e35851
5 changed files with 50 additions and 7 deletions
+5
View File
@@ -138,6 +138,11 @@ func Execute() {
// check for update
check_update()
err := utils.FetchConfig()
if err != nil {
panic(fmt.Sprintf("Error fetching config: %v", err))
}
// author file check
author_file, err := utils.CheckAuthorFile(os.Stdin, os.Stdout)
if err != nil {
+1 -5
View File
@@ -14,11 +14,7 @@ import (
// An example of the author file can be found in the examples folder of the repo
func Find_authorfile() string {
if os.Getenv("author_file") == "" {
dirs, err := os.UserConfigDir()
if err != nil {
panic(fmt.Sprintf("Error getting user config directory: %v", err))
}
return (dirs + "/cocommit/authors.json")
return ConfigVar.GetAuthorFile()
} else {
return os.Getenv("author_file")
}
+1
View File
@@ -0,0 +1 @@
Test content