Only read config dir if db is not provided.

This commit is contained in:
Tim Shaffer 2024-10-31 10:11:45 -04:00 committed by nkanaev
parent 2dc58c5c8e
commit 6b12715506

View File

@ -90,12 +90,12 @@ func main() {
log.SetOutput(os.Stdout) log.SetOutput(os.Stdout)
} }
if db == "" {
configPath, err := os.UserConfigDir() configPath, err := os.UserConfigDir()
if err != nil { if err != nil {
log.Fatal("Failed to get config dir: ", err) log.Fatal("Failed to get config dir: ", err)
} }
if db == "" {
storagePath := filepath.Join(configPath, "yarr") storagePath := filepath.Join(configPath, "yarr")
if err := os.MkdirAll(storagePath, 0755); err != nil { if err := os.MkdirAll(storagePath, 0755); err != nil {
log.Fatal("Failed to create app config dir: ", err) log.Fatal("Failed to create app config dir: ", err)