| 59 | } |
| 60 | |
| 61 | func initLinuxPaths() { |
| 62 | home := os.Getenv("HOME") |
| 63 | |
| 64 | // XDG Base Directory Specification |
| 65 | xdgConfig := os.Getenv("XDG_CONFIG_HOME") |
| 66 | if xdgConfig == "" { |
| 67 | xdgConfig = filepath.Join(home, ".config") |
| 68 | } |
| 69 | |
| 70 | xdgData := os.Getenv("XDG_DATA_HOME") |
| 71 | if xdgData == "" { |
| 72 | xdgData = filepath.Join(home, ".local", "share") |
| 73 | } |
| 74 | |
| 75 | xdgCache := os.Getenv("XDG_CACHE_HOME") |
| 76 | if xdgCache == "" { |
| 77 | xdgCache = filepath.Join(home, ".cache") |
| 78 | } |
| 79 | |
| 80 | xdgState := os.Getenv("XDG_STATE_HOME") |
| 81 | if xdgState == "" { |
| 82 | xdgState = filepath.Join(home, ".local", "state") |
| 83 | } |
| 84 | |
| 85 | configDir = filepath.Join(xdgConfig, "aster") |
| 86 | dataDir = filepath.Join(xdgData, "aster") |
| 87 | logDir = filepath.Join(xdgState, "aster", "logs") |
| 88 | cacheDir = filepath.Join(xdgCache, "aster") |
| 89 | } |
| 90 | |
| 91 | // ConfigDir returns the configuration directory. |
| 92 | // This is where config.yaml, recipes, and extensions are stored. |