Fix config directory in flatpak

This commit is contained in:
Bernd Schoolmann 2023-12-28 14:32:41 +01:00
parent 6084844a31
commit 4c8fb1d2ab
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package cmd
import (
"os"
"os/signal"
"strings"
"github.com/awnumar/memguard"
"github.com/quexten/goldwarden/agent"
@ -22,6 +23,8 @@ var daemonizeCmd = &cobra.Command{
isFlatpak := err == nil
if isFlatpak {
runtimeConfig.ConfigDirectory = "~/.var/app/com.quexten.Goldwarden/config/goldwarden.json"
userHome, _ := os.UserHomeDir()
runtimeConfig.ConfigDirectory = strings.ReplaceAll(runtimeConfig.ConfigDirectory, "~", userHome)
println("Flatpak Config directory: " + runtimeConfig.ConfigDirectory)
}