mirror of
https://github.com/kamask-dev/pchelpmaster.git
synced 2026-11-11 05:49:38 +00:00
feat(pocketbase): add pocketbase dev setup and superuser script
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XJAY6Rgre8viuBjhA6djfW
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a0ae3f1254
commit
f61ba84228
@@ -0,0 +1,12 @@
|
||||
// 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' });
|
||||
Reference in New Issue
Block a user