fix(regression): persist auto-enabled directory config

This commit is contained in:
Tak Hoffman 2026-03-27 23:47:43 -05:00
parent 687d23ae8d
commit 384bdde514
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -150,5 +150,6 @@ describe("registerDirectoryCli", () => {
cfg: autoEnabledConfig,
}),
);
expect(mocks.writeConfigFile).toHaveBeenCalledWith(autoEnabledConfig);
});
});

View File

@ -98,10 +98,11 @@ export function registerDirectoryCli(program: Command) {
.option("--json", "Output JSON", false);
const resolve = async (opts: { channel?: string; account?: string }) => {
let cfg = applyPluginAutoEnable({
const autoEnabled = applyPluginAutoEnable({
config: loadConfig(),
env: process.env,
}).config;
});
let cfg = autoEnabled.config;
const explicitChannel = opts.channel?.trim();
const resolvedExplicit = explicitChannel
? await resolveInstallableChannelPlugin({
@ -115,6 +116,8 @@ export function registerDirectoryCli(program: Command) {
if (resolvedExplicit?.configChanged) {
cfg = resolvedExplicit.cfg;
await writeConfigFile(cfg);
} else if (autoEnabled.changes.length > 0) {
await writeConfigFile(cfg);
}
const selection = explicitChannel
? {