( profile: string | null, )
| 696 | } |
| 697 | |
| 698 | export async function persistActiveSessionDefaultsProfile( |
| 699 | profile: string | null, |
| 700 | ): Promise<{ path: string }> { |
| 701 | if (!storeState.initialized || !storeState.fs || !storeState.cwd) { |
| 702 | throw new Error('Config store has not been initialized.'); |
| 703 | } |
| 704 | |
| 705 | const normalizedProfile = normalizeSessionDefaultsProfileName(profile); |
| 706 | |
| 707 | const result = await persistActiveSessionDefaultsProfileToProjectConfig({ |
| 708 | fs: storeState.fs, |
| 709 | cwd: storeState.cwd, |
| 710 | profile: normalizedProfile, |
| 711 | }); |
| 712 | |
| 713 | storeState.fileConfig = applyActiveProfileToFileConfig({ |
| 714 | fileConfig: getCurrentFileConfig(), |
| 715 | profile: normalizedProfile, |
| 716 | }); |
| 717 | refreshResolvedSessionFields(); |
| 718 | |
| 719 | return result; |
| 720 | } |
| 721 | |
| 722 | export function __resetConfigStoreForTests(): void { |
| 723 | storeState.initialized = false; |
no test coverage detected