| 785 | |
| 786 | #ifdef LIQUID |
| 787 | fs::path GetDefaultDataDir() |
| 788 | { |
| 789 | // Windows < Vista: C:\Documents and Settings\Username\Application Data\Liquid |
| 790 | // Windows >= Vista: C:\Users\Username\AppData\Roaming\Liquid |
| 791 | // Mac: ~/Library/Application Support/Liquid |
| 792 | // Unix: ~/.liquid |
| 793 | #ifdef WIN32 |
| 794 | // Windows |
| 795 | return GetSpecialFolderPath(CSIDL_APPDATA) / "Liquid"; |
| 796 | #else |
| 797 | fs::path pathRet; |
| 798 | char* pszHome = getenv("HOME"); |
| 799 | if (pszHome == nullptr || strlen(pszHome) == 0) |
| 800 | pathRet = fs::path("/"); |
| 801 | else |
| 802 | pathRet = fs::path(pszHome); |
| 803 | #ifdef MAC_OSX |
| 804 | // Mac |
| 805 | return pathRet / "Library/Application Support/Liquid"; |
| 806 | #else |
| 807 | // Unix |
| 808 | return pathRet / ".liquid"; |
| 809 | #endif |
| 810 | #endif |
| 811 | } |
| 812 | #else |
| 813 | fs::path GetDefaultDataDir() |
| 814 | { |
no test coverage detected