rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61)
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Architecture Guardrails (push) Successful in 2m38s
CI / Assistant Split Regression (push) Successful in 3m33s
CI / Typecheck (push) Successful in 3m51s
CI / Lint (push) Successful in 5m2s
CI / E2E Tests (push) Has been cancelled
CI / Fresh-Linux Docker Deploy (push) Has been cancelled
CI / Release Images (push) Has been cancelled
CI / Build (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
rename(phase 1): CapaKraken → Nexus across code, UI, docs, CI (#61) Co-authored-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com> Co-committed-by: Hartmut Nörenberg <hn@hartmut-noerenberg.com>
This commit was merged in pull request #61.
This commit is contained in:
@@ -2,7 +2,7 @@ import { execFileSync } from "node:child_process";
|
||||
import { mkdirSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { hash } from "@node-rs/argon2";
|
||||
import { SystemRole } from "@capakraken/shared";
|
||||
import { SystemRole } from "@nexus/shared";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
import { assertDestructiveDbAllowed } from "./destructive-db-guard.js";
|
||||
import { loadWorkspaceEnv, resolveWorkspacePath } from "./load-workspace-env.js";
|
||||
@@ -27,9 +27,9 @@ function parseArgs(argv: string[]): ResetOptions {
|
||||
force: false,
|
||||
skipBackup: false,
|
||||
backupDir: DEFAULT_BACKUP_DIR,
|
||||
adminEmail: "admin@capakraken.dev",
|
||||
adminEmail: "admin@nexus.dev",
|
||||
adminPassword: "admin123",
|
||||
adminName: "CapaKraken Admin",
|
||||
adminName: "Nexus Admin",
|
||||
};
|
||||
|
||||
for (let index = 0; index < argv.length; index += 1) {
|
||||
@@ -77,21 +77,17 @@ function createTimestamp() {
|
||||
}
|
||||
|
||||
function quoteIdentifier(identifier: string): string {
|
||||
return `"${identifier.replace(/"/g, "\"\"")}"`;
|
||||
return `"${identifier.replace(/"/g, '""')}"`;
|
||||
}
|
||||
|
||||
function createDatabaseBackup(databaseUrl: string, backupDir: string): string {
|
||||
mkdirSync(backupDir, { recursive: true });
|
||||
|
||||
const backupPath = resolve(backupDir, `dispo-reset-${createTimestamp()}.dump`);
|
||||
execFileSync(
|
||||
"pg_dump",
|
||||
["--format=custom", "--file", backupPath, databaseUrl],
|
||||
{
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
},
|
||||
);
|
||||
execFileSync("pg_dump", ["--format=custom", "--file", backupPath, databaseUrl], {
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
return backupPath;
|
||||
}
|
||||
@@ -193,7 +189,11 @@ async function main() {
|
||||
const truncatedTables = await truncatePublicTables();
|
||||
console.log(`Truncated ${truncatedTables.length} public tables.`);
|
||||
|
||||
const admin = await bootstrapPlatform(options.adminEmail, options.adminPassword, options.adminName);
|
||||
const admin = await bootstrapPlatform(
|
||||
options.adminEmail,
|
||||
options.adminPassword,
|
||||
options.adminName,
|
||||
);
|
||||
console.log(`Bootstrap admin created: ${admin.email}`);
|
||||
|
||||
if (backupPath) {
|
||||
|
||||
Reference in New Issue
Block a user