// `bun run fix:env` — give every variable in `.env` the `OFFICERDEV_` prefix. // // A thin front for `servers/env-prefix.ts`, which is where the rules live. Deliberately that way round: // the same conversion runs on every restart from the server settings screen, and a router reaching into // `scripts/` to do it would make a maintenance script part of the request path. import { join } from 'node:path'; import { fixEnvFile } from '../src/servers/env-prefix'; const path = process.argv[2] ?? join(process.cwd(), '.env'); const { changed, alreadyPrefixed } = fixEnvFile(path); if (changed.length) console.log(`[fix:env] prefixed ${changed.length}: ${changed.join(', ')}`); else console.log(`[fix:env] nothing to do (${alreadyPrefixed} already prefixed)`);