fix: console command
This commit is contained in:
parent
6f7423037a
commit
820352f280
@ -3,16 +3,19 @@ import Application from '../application';
|
|||||||
const REPL = require('repl');
|
const REPL = require('repl');
|
||||||
|
|
||||||
export default (app: Application) => {
|
export default (app: Application) => {
|
||||||
app.command('console').action(async () => {
|
app
|
||||||
await app.start();
|
.command('console')
|
||||||
const repl = (REPL.start('nocobase > ').context.app = app);
|
.preload()
|
||||||
repl.on('exit', async function (err) {
|
.action(async () => {
|
||||||
if (err) {
|
await app.start();
|
||||||
console.log(err);
|
const repl = (REPL.start('nocobase > ').context.app = app);
|
||||||
process.exit(1);
|
repl.on('exit', async function (err) {
|
||||||
}
|
if (err) {
|
||||||
await app.stop();
|
console.log(err);
|
||||||
process.exit(0);
|
process.exit(1);
|
||||||
|
}
|
||||||
|
await app.stop();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
@ -11,9 +11,9 @@ import restart from './restart';
|
|||||||
import start from './start';
|
import start from './start';
|
||||||
import stop from './stop';
|
import stop from './stop';
|
||||||
import upgrade from './upgrade';
|
import upgrade from './upgrade';
|
||||||
|
import consoleCommand from './console';
|
||||||
export function registerCli(app: Application) {
|
export function registerCli(app: Application) {
|
||||||
// console(app);
|
consoleCommand(app);
|
||||||
dbAuth(app);
|
dbAuth(app);
|
||||||
createMigration(app);
|
createMigration(app);
|
||||||
dbClean(app);
|
dbClean(app);
|
||||||
|
Loading…
Reference in New Issue
Block a user