2026-01-23 04:16:32 +00:00
|
|
|
import type { RuntimeEnv } from "../runtime.js";
|
|
|
|
|
import { displayPath } from "../utils.js";
|
2026-01-27 12:19:58 +00:00
|
|
|
import { CONFIG_PATH } from "./paths.js";
|
2026-01-23 04:16:32 +00:00
|
|
|
|
|
|
|
|
type LogConfigUpdatedOptions = {
|
|
|
|
|
path?: string;
|
|
|
|
|
suffix?: string;
|
|
|
|
|
};
|
|
|
|
|
|
2026-01-27 12:19:58 +00:00
|
|
|
export function formatConfigPath(path: string = CONFIG_PATH): string {
|
2026-01-23 04:16:32 +00:00
|
|
|
return displayPath(path);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function logConfigUpdated(runtime: RuntimeEnv, opts: LogConfigUpdatedOptions = {}): void {
|
2026-01-27 12:19:58 +00:00
|
|
|
const path = formatConfigPath(opts.path ?? CONFIG_PATH);
|
2026-01-23 04:16:32 +00:00
|
|
|
const suffix = opts.suffix ? ` ${opts.suffix}` : "";
|
|
|
|
|
runtime.log(`Updated ${path}${suffix}`);
|
|
|
|
|
}
|