import { writeFile } from 'node:fs/promises';
import { stdin as input, stdout as output } from 'node:process';
import { createInterface } from 'node:readline/promises';
import { defaultPalette } from '../../palette';
import { createSnapshotTheme } from './createSnapshotTheme';
(async () => {
    const theme = createSnapshotTheme({ palette: defaultPalette });
    const json = JSON.stringify(theme);
    const relPath = './snapshots/theme.snapshot.json';
    const rl = createInterface({ input, output });
    const answer = await rl.question(`Snapshot will be written to ${relPath}.\n y / N: `);
    rl.close();
    if (!answer.toLowerCase().startsWith('y')) {
        // biome-ignore lint/suspicious/noConsole: <>
        console.log('Cancelled');
    }
    writeFile(relPath, json);
})();
