Files
cv/sync_profile.js

18 lines
729 B
JavaScript

#!/usr/bin/env node
// sync_profile.js — regenerate server/profile.json from profile_data.js
// Run this after ANY edit to profile_data.js: node sync_profile.js
const fs = require('fs');
const path = require('path');
const { PROFILE_DATA, renderProfileText } = require('./profile_data.js');
const target = path.join(__dirname, 'server', 'profile.json');
const payload = Object.assign({}, PROFILE_DATA, {
_generated: 'AUTO-GENERATED from profile_data.js — do not edit by hand. Run: node sync_profile.js',
_generatedAt: new Date().toISOString(),
profileText: renderProfileText()
});
fs.writeFileSync(target, JSON.stringify(payload, null, 2));
console.log(`✅ Synced ${target} (${fs.statSync(target).size} bytes)`);