diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-11 20:48:01 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-11 20:48:01 +0200 |
| commit | 8312a19b4e1f9849aae9912433824b19e03a8daf (patch) | |
| tree | 8ca381d8a6549e94b15a5c65f688a353f0da98ca /internal/appconfig/config.go | |
| parent | 97b8887fb3448fd08524111d98425859bec8789f (diff) | |
refactor: consolidate cache and state into .local/hexai directory
Move all cache and state files under ~/.local/hexai/ with subdirectories:
- ~/.local/hexai/cache/ (was ~/.cache/hexai/)
- ~/.local/hexai/state/ (was ~/.local/state/hexai/)
- ~/.local/hexai/data/ (was ~/.local/share/hexai/)
This centralizes all non-config hexai files under a single .local/hexai directory,
making it easier to manage and back up user data.
Amp-Thread-ID: https://ampcode.com/threads/T-019c4e03-73db-70a2-ae27-3e1cc31d59c3
Co-authored-by: Amp <amp@ampcode.com>
Diffstat (limited to 'internal/appconfig/config.go')
| -rw-r--r-- | internal/appconfig/config.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/appconfig/config.go b/internal/appconfig/config.go index 859b2c1..8ae9597 100644 --- a/internal/appconfig/config.go +++ b/internal/appconfig/config.go @@ -1284,7 +1284,7 @@ func ConfigPath() (string, error) { return configPath, nil } -// StateDir returns the XDG state directory for hexai (~/.local/state/hexai by default). +// StateDir returns the XDG state directory for hexai (~/.local/hexai/state by default). // Creates the directory if it doesn't exist. This is used for persistent state data // like logs and history that should survive reboots. func StateDir() (string, error) { @@ -1294,10 +1294,10 @@ func StateDir() (string, error) { if err != nil { return "", fmt.Errorf("cannot find user home directory: %v", err) } - stateHome = filepath.Join(home, ".local", "state") + stateHome = filepath.Join(home, ".local", "hexai") } - stateDir := filepath.Join(stateHome, "hexai") + stateDir := filepath.Join(stateHome, "state") if err := os.MkdirAll(stateDir, 0o755); err != nil { return "", fmt.Errorf("cannot create state directory: %v", err) } |
