| 154 | } |
| 155 | #else |
| 156 | string getHomeDirectory() { |
| 157 | string home = getEnvVar("XDG_CACHE_HOME"); |
| 158 | if (!home.empty()) { return home; } |
| 159 | |
| 160 | home = getEnvVar("HOME"); |
| 161 | if (!home.empty()) { return home; } |
| 162 | |
| 163 | return getpwuid(getuid())->pw_dir; |
| 164 | } |
| 165 | #endif |
| 166 | |
| 167 | bool directoryExists(const string& path) { |