refactor: centralize config update logging

This commit is contained in:
Peter Steinberger
2026-01-23 04:01:11 +00:00
parent 246ee490f6
commit e750ad5e75
20 changed files with 73 additions and 70 deletions

View File

@@ -12,6 +12,7 @@ import {
import { formatCliCommand } from "../cli/command-format.js";
import type { ClawdbotConfig } from "../config/config.js";
import { CONFIG_PATH_CLAWDBOT, readConfigFileSnapshot, writeConfigFile } from "../config/config.js";
import { logConfigUpdated } from "../config/logging.js";
import { resolveGatewayService } from "../daemon/service.js";
import { resolveGatewayAuth } from "../gateway/auth.js";
import { buildGatewayConnectionDetails } from "../gateway/call.js";
@@ -270,7 +271,7 @@ export async function doctorCommand(
if (shouldWriteConfig) {
cfg = applyWizardMetadata(cfg, { command: "doctor", mode: resolveMode(cfg) });
await writeConfigFile(cfg);
runtime.log(`Updated ${shortenHomePath(CONFIG_PATH_CLAWDBOT)}`);
logConfigUpdated(runtime);
const backupPath = `${CONFIG_PATH_CLAWDBOT}.bak`;
if (fs.existsSync(backupPath)) {
runtime.log(`Backup: ${shortenHomePath(backupPath)}`);