mirror of
https://github.com/idootop/mi-gpt.git
synced 2024-09-20 06:45:38 +00:00
chore: trace initDB log
This commit is contained in:
parent
1992317f10
commit
8138d77e62
|
@ -50,7 +50,7 @@ export class MiGPT {
|
|||
}
|
||||
|
||||
async start() {
|
||||
await initDB();
|
||||
await initDB(this.speaker.debug);
|
||||
const main = () => {
|
||||
console.log(kBannerASCII);
|
||||
return this.ai.run();
|
||||
|
|
|
@ -41,12 +41,12 @@ export function getDBInfo() {
|
|||
return { dbPath, withSchema };
|
||||
}
|
||||
|
||||
export async function initDB() {
|
||||
export async function initDB(debug = false) {
|
||||
const { dbPath, withSchema } = getDBInfo();
|
||||
if (!exists(dbPath)) {
|
||||
await deleteFile(".bot.json");
|
||||
await Shell.run(`npx prisma migrate dev --name init ${withSchema}`, {
|
||||
silent: true,
|
||||
silent: debug ? false : true,
|
||||
});
|
||||
}
|
||||
const success = exists(dbPath);
|
||||
|
|
Loading…
Reference in New Issue
Block a user