#1180: native Windows Hermes -- the install.ps1 CLI, the MSIX package and * the Desktop app -- defaults HERMES_HOME to %LOCALAPPDATA%\hermes and keeps a * legacy ~/.hermes only while the new directory is absent (hermes-agent * website/docs/user-guide/windows-native.md "Data layout"; * apps/desktop/electron/data-paths.mjs resolveDesktopHermesHome). Probing * only ~/.hermes missed those install
| 2790 | * only ~/.hermes missed those installs and aimed config.yaml at a home Hermes |
| 2791 | * never reads. Other platforms use ~/.hermes. */ |
| 2792 | static void cbm_hermes_home_dir_for(const char *home_dir, bool windows, char *out, size_t out_sz) { |
| 2793 | const char *fallback = ".hermes"; |
| 2794 | if (windows) { |
| 2795 | char native[CLI_BUF_1K]; |
| 2796 | char legacy[CLI_BUF_1K]; |
| 2797 | snprintf(native, sizeof(native), "%s/AppData/Local/hermes", home_dir); |
| 2798 | snprintf(legacy, sizeof(legacy), "%s/.hermes", home_dir); |
| 2799 | if (dir_exists(native) || !dir_exists(legacy)) { |
| 2800 | fallback = "AppData/Local/hermes"; |
| 2801 | } |
| 2802 | } |
| 2803 | cbm_env_home_dir("HERMES_HOME", home_dir, fallback, out, out_sz); |
| 2804 | } |
| 2805 | |
| 2806 | static void cbm_hermes_home_dir(const char *home_dir, char *out, size_t out_sz) { |
| 2807 | #ifdef _WIN32 |
no test coverage detected