mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
@@ -11,9 +11,11 @@ export default async function count(collection: string) {
|
||||
const count = Number(records[0].count);
|
||||
|
||||
console.log(count);
|
||||
database.destroy();
|
||||
process.exit(0);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
database.destroy();
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,11 @@ export default async function start() {
|
||||
try {
|
||||
await installSeeds(database);
|
||||
await runMigrations(database, 'latest');
|
||||
database.destroy();
|
||||
process.exit(0);
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
database.destroy();
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@ export default async function migrate(direction: 'latest' | 'up' | 'down') {
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
process.exit(1);
|
||||
} finally {
|
||||
database.destroy();
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ export default async function init(options: Record<string, any>) {
|
||||
role: roleID,
|
||||
});
|
||||
|
||||
db.destroy();
|
||||
await db.destroy();
|
||||
|
||||
console.log(`
|
||||
Your project has been created at ${chalk.green(rootPath)}.
|
||||
@@ -126,4 +126,6 @@ Start Directus by running:
|
||||
${chalk.blue('cd')} ${rootPath}
|
||||
${chalk.blue('npx directus')} start
|
||||
`);
|
||||
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,10 @@ export default async function rolesCreate({ name, admin }: any) {
|
||||
|
||||
const id = await service.create({ name, admin_access: admin });
|
||||
console.log(id);
|
||||
database.destroy();
|
||||
process.exit(0);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
database.destroy();
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,10 @@ export default async function usersCreate({ email, password, role }: any) {
|
||||
|
||||
const id = await service.create({ email, password, role, status: 'active' });
|
||||
console.log(id);
|
||||
database.destroy();
|
||||
process.exit(0);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} finally {
|
||||
database.destroy();
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user