@megaorm/cli
Version:
This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).
31 lines • 1.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RemoveForCommand = void 0;
const MegaCommand_1 = require("../MegaCommand");
const RemoveGeneratorCommand_1 = require("./RemoveGeneratorCommand");
const RemoveSeederCommand_1 = require("./RemoveSeederCommand");
const RemoveModelCommand_1 = require("./RemoveModelCommand");
/**
* Represents a command to add a command file to a specific folder in the project
* based on MegaORM configuration.
*
* @extends MegaCommand
*/
class RemoveForCommand extends MegaCommand_1.MegaCommand {
/**
* Executes 3 commands to add `generator`, `seeder` and a `model` file for the specified table.
*
* @returns A promise that resolves when all files has been added successfully or rejects with an error.
*/
static exec() {
return new Promise((resolve, reject) => {
RemoveGeneratorCommand_1.RemoveGeneratorCommand.exec()
.then(() => RemoveSeederCommand_1.RemoveSeederCommand.exec())
.then(() => RemoveModelCommand_1.RemoveModelCommand.exec())
.then(resolve)
.catch(reject);
});
}
}
exports.RemoveForCommand = RemoveForCommand;
//# sourceMappingURL=RemoveForCommand.js.map