Files
portfolio2023/node_modules/@adonisjs/repl/build/commands/AdonisRepl.js
T
2023-11-24 22:35:41 +01:00

34 lines
1.0 KiB
JavaScript

"use strict";
/*
* @adonisjs/repl
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const standalone_1 = require("@adonisjs/core/build/standalone");
class ReplCommand extends standalone_1.BaseCommand {
async run() {
this.application.container.withBindings(['Adonis/Core/Route'], (Route) => {
Route.commit();
});
this.application.container.use('Adonis/Addons/Repl').start();
/**
* Gracefully shutdown the application
*/
this.application.container.use('Adonis/Addons/Repl').server.on('exit', async () => {
await this.application.shutdown();
});
}
}
exports.default = ReplCommand;
ReplCommand.commandName = 'repl';
ReplCommand.description = 'Start a new REPL session';
ReplCommand.settings = {
loadApp: true,
environment: 'repl',
stayAlive: true,
};