Resolve Grok Build's user configuration directory. * Honors $GROK_HOME; falls back to "$home_dir/.grok". */
| 3013 | /* Resolve Grok Build's user configuration directory. |
| 3014 | * Honors $GROK_HOME; falls back to "$home_dir/.grok". */ |
| 3015 | static void cbm_grok_config_dir(const char *home_dir, char *out, size_t out_sz) { |
| 3016 | char env_buf[CLI_BUF_1K]; |
| 3017 | const char *custom = cbm_safe_getenv("GROK_HOME", env_buf, sizeof(env_buf), NULL); |
| 3018 | snprintf(out, out_sz, "%s", custom && custom[0] ? custom : ""); |
| 3019 | if ((!custom || !custom[0]) && home_dir && home_dir[0]) { |
| 3020 | snprintf(out, out_sz, "%s/.grok", home_dir); |
| 3021 | } |
| 3022 | } |
| 3023 | |
| 3024 | static bool cbm_hook_script_name_safe(const char *script_name) { |
| 3025 | if (!script_name || !script_name[0]) { |
no test coverage detected