mirror of
https://github.com/merlinhu1/truthmark.git
synced 2026-08-25 07:53:25 +02:00
* feat: add interactive platform selection to init * chore: remove completed OpenSpec artifacts * chore: remove implemented design note * fix: protect init lifecycle from unsafe config paths * fix: support clearing init platforms from CLI * docs: retire config command from repository rules * docs: align init lifecycle and clear-platform contracts * docs: keep repository guidance current-state focused * docs: limit cleanup to repository-native documents * docs: preserve historical version notes --------- Co-authored-by: MerlinH <merlinh221@gmail.com>
15 lines
529 B
TypeScript
15 lines
529 B
TypeScript
import fs from "node:fs/promises";
|
|
import path from "node:path";
|
|
|
|
import type { TruthmarkPlatform } from "../../src/config/schema.js";
|
|
import { renderConfig } from "../../src/config/render.js";
|
|
|
|
export const writeTruthmarkConfig = async (
|
|
rootDir: string,
|
|
platforms: readonly TruthmarkPlatform[] = [],
|
|
): Promise<void> => {
|
|
const configPath = path.join(rootDir, ".truthmark/config.yml");
|
|
await fs.mkdir(path.dirname(configPath), { recursive: true });
|
|
await fs.writeFile(configPath, renderConfig(platforms), "utf8");
|
|
};
|