import { mkdirSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';

export function setupAccountConfigDir(
  configDir: string,
  extracted: { configJson: object; credentials: string },
): void {
  mkdirSync(configDir, { recursive: true });

  // Write .claude.json
  writeFileSync(join(configDir, '.claude.json'), JSON.stringify(extracted.configJson, null, 2));

  // Write .credentials.json
  writeFileSync(join(configDir, '.credentials.json'), extracted.credentials);
}
