refactor: simplify homeDir and appConfig usage

This commit is contained in:
Mathis Maquenne
2025-06-23 20:58:08 -04:00
parent a619b37922
commit 33e774d078
7 changed files with 46 additions and 31 deletions
+1 -2
View File
@@ -20,8 +20,7 @@ type Watcher struct {
}
func New(appConfig *config.Config) *Watcher {
homeDir, _ := os.UserHomeDir()
logFile := filepath.Join(homeDir, ".godeez", "watcher.log")
logFile := filepath.Join(appConfig.HomeDir, ".godeez", "watcher.log")
file, err := os.OpenFile(logFile, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
if err != nil {
log.Fatalf("Failed to open log file: %v\n", err)