mirror of
https://github.com/kamask-dev/pchelpmaster.git
synced 2026-11-11 13:59:38 +00:00
Routine formatting only, no functional changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016GHq7GcQtB91bnq3832H76
15 lines
526 B
JavaScript
15 lines
526 B
JavaScript
// Creates the PocketBase superuser or resets its password (idempotent).
|
|
import { execFileSync } from 'node:child_process';
|
|
|
|
const { PB_SUPERUSER_EMAIL: email, PB_SUPERUSER_PASSWORD: password } = process.env;
|
|
const dir = process.env.PB_DIR || 'pocketbase/pb_data';
|
|
|
|
if (!email || !password) {
|
|
console.error('PB_SUPERUSER_EMAIL and PB_SUPERUSER_PASSWORD must be set (see .env.example)');
|
|
process.exit(1);
|
|
}
|
|
|
|
execFileSync('pocketbase', ['superuser', 'upsert', email, password, '--dir', dir], {
|
|
stdio: 'inherit',
|
|
});
|