( dir: string, )
| 718 | }, |
| 719 | }); |
| 720 | function resolveContextOptionsForProject( |
| 721 | dir: string, |
| 722 | ): PiContextHandlerOptions { |
| 723 | const cached = contextOptionsByDir.get(dir); |
| 724 | if (cached) return cached; |
| 725 | // A different checkout: re-resolve config + historian/auto-search from |
| 726 | // the new cwd. The launch dir is pre-seeded below so this branch only |
| 727 | // runs for genuine switches. |
| 728 | ensureConfigLocationsMigrated(dir); |
| 729 | const switchedConfig = loadPiConfig({ cwd: dir }).config; |
| 730 | const switchedHistorian = resolveHistorianFromConfig(switchedConfig); |
| 731 | if (switchedHistorian) { |
| 732 | switchedHistorian.onStatusChange = (ctx) => { |
| 733 | updateStatusLine(ctx, { |
| 734 | db: database, |
| 735 | projectIdentity: resolveCurrentProject(ctx).projectIdentity, |
| 736 | }); |
| 737 | }; |
| 738 | } |
| 739 | const built = buildContextOptions( |
| 740 | switchedConfig, |
| 741 | switchedHistorian, |
| 742 | resolveAutoSearchFromConfig(switchedConfig), |
| 743 | ); |
| 744 | contextOptionsByDir.set(dir, built); |
| 745 | return built; |
| 746 | } |
| 747 | const bootContextOptions = buildContextOptions( |
| 748 | config, |
| 749 | historianConfig, |
nothing calls this directly
no test coverage detected