Initial scaffold: project structure, .gitignore, go.mod

This commit is contained in:
Axel Meyer
2026-03-03 21:07:31 +01:00
commit 2256df9dd7
15 changed files with 892 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
//go:build linux
package config
import (
"os"
"path/filepath"
)
// ConfigDir returns ~/.config/syncwarden.
func ConfigDir() string {
if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" {
return filepath.Join(xdg, "syncwarden")
}
home, _ := os.UserHomeDir()
return filepath.Join(home, ".config", "syncwarden")
}
// SyncthingConfigPath returns the default Syncthing config.xml path on Linux.
func SyncthingConfigPath() string {
if xdg := os.Getenv("XDG_CONFIG_HOME"); xdg != "" {
return filepath.Join(xdg, "syncthing", "config.xml")
}
home, _ := os.UserHomeDir()
return filepath.Join(home, ".config", "syncthing", "config.xml")
}