Add platform-independent path/config resolution library

Implements core/paths (Config/Data/State/Cache/Runtime/Log/Bin
directory resolution with canonical-vs-search-dir separation, XDG on
Unix, native APPDATA/LOCALAPPDATA/PROGRAMDATA layering on Windows,
~/Library on macOS Desktop, injectable environment/platform for
deterministic cross-platform tests) and core/config (file search,
first-match resolution, layered YAML merging, safe ${VAR} expansion,
Explain/doctor introspection) on top of the shared Application/
Kind/Scope model in the core package.
This commit is contained in:
terminar committed 2026-09-19 16:26:01 +02:00
1 parent 027b327c3d
commit 13801bec11
41 files changed
+4834 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
package paths
// freebsdFlavor follows FreeBSD/ports conventions rather than blindly
// reusing Linux's FHS layout (spec section 33/56): system configuration
// and locally-installed data live under /usr/local, not /etc or
// /usr/share, and system-writable application data conventionally lives
// under /var/db rather than /var/lib.
var freebsdFlavor = unixFlavor{
systemConfigDirs: []string{"/usr/local/etc"},
systemDataDirs: []string{"/usr/local/share", "/usr/share"},
systemDataBase: "/var/db",
systemStateBase: "/var/db",
systemCacheBase: "/var/cache",
systemRuntimeBase: "/var/run",
systemLogBase: "/var/log",
systemBinDir: "/usr/local/bin",
}