#!/usr/bin/env bun import fs from 'fs'; import { parseArgs } from 'util'; const { positionals } = parseArgs({ args: Bun.argv, options: {}, strict: true, allowPositionals: true, }); const currentDate = new Date().toISOString().split('T')[0]; const host = positionals[2]; const sitemapTemplate = ` https://${host}/ ${currentDate} 1.0 https://${host}/connect ${currentDate} 0.7 `; const sitemapPath = './public/sitemap.xml'; fs.writeFile(sitemapPath, sitemapTemplate, err => { if (err) { console.error('Error writing sitemap file:', err); process.exit(1); } console.log('Sitemap updated successfully with current date:', currentDate); });