Skip to content

resolveIdentityProfileConfigPath

resolveIdentityProfileConfigPath(identityProfile): string | undefined

Defined in: core/dist/config/loader.d.ts:50

STRICT existence check for an EXPLICITLY-named identity profile: does .gsloth/.gsloth-settings/<identityProfile>/<config> resolve to a real config file anywhere in the same up-tree search findProjectConfigPath walks? Returns the resolved profile config path (nearest dir, then format precedence) when the profile has its OWN config, undefined otherwise.

Unlike findProjectConfigPath, it matches ONLY the profile-specific path — it NEVER falls through to a plain <dir>/<config> and NEVER falls back to the global config. That strictness is the whole point: it lets a caller distinguish “this named profile really exists” from “a bare config happens to be present / a global config exists,” a distinction the loader’s fall-through deliberately blurs.

PURE PREDICATE — never throws, never calls exit (contrast the loader’s interactive-CLI exit(1) safety net in initConfig). So batch/eval code (e.g. gth eval --judge <profile> and BATCH-12’s identity matrix) can pre-check an explicitly-requested profile and raise its OWN catchable error / graceful exit code instead of dying on an uncatchable process.exit. A blank/whitespace-only name counts as “no profile” → undefined.

string

The explicitly-requested identity profile name.

string | undefined

The resolved profile config path, or undefined when the profile has no config.