fix: console command

This commit is contained in:
Chareice 2024-03-17 09:19:54 +08:00
parent 6f7423037a
commit 820352f280
No known key found for this signature in database
2 changed files with 16 additions and 13 deletions

View File

@ -3,7 +3,10 @@ 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
.command('console')
.preload()
.action(async () => {
await app.start(); await app.start();
const repl = (REPL.start('nocobase > ').context.app = app); const repl = (REPL.start('nocobase > ').context.app = app);
repl.on('exit', async function (err) { repl.on('exit', async function (err) {

View File

@ -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);