2026-01-23 04:16:32 +00:00
|
|
|
import type { RuntimeEnv } from "../runtime.js";
|
|
|
|
|
import { displayPath } from "../utils.js";
|
2026-03-08 09:59:32 -05:00
|
|
|
import { createConfigIO } from "./io.js";
|
2026-01-23 04:16:32 +00:00
|
|
|
|
|
|
|
|
type LogConfigUpdatedOptions = {
|
|
|
|
|
path?: string;
|
|
|
|
|
suffix?: string;
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-08 09:59:32 -05:00
|
|
|
export function formatConfigPath(path: string = createConfigIO().configPath): string {
|
2026-01-23 04:16:32 +00:00
|
|
|
return displayPath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function logConfigUpdated(runtime: RuntimeEnv, opts: LogConfigUpdatedOptions = {}): void {
|
2026-03-08 09:59:32 -05:00
|
|
|
const path = formatConfigPath(opts.path ?? createConfigIO().configPath);
|
2026-01-23 04:16:32 +00:00
|
|
|
const suffix = opts.suffix ? ` ${opts.suffix}` : "";
|
|
|
|
|
runtime.log(`Updated ${path}${suffix}`);
|
|
|
|
|
}
|