@megaorm/cli
Version:
This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).
31 lines • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddForCommand = void 0;
const MegaCommand_1 = require("../MegaCommand");
const AddGeneratorCommand_1 = require("./AddGeneratorCommand");
const AddSeederCommand_1 = require("./AddSeederCommand");
const AddModelCommand_1 = require("./AddModelCommand");
/**
* Represents a command to add a command file to a specific folder in the project
* based on MegaORM configuration.
*
* @extends MegaCommand
*/
class AddForCommand 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) => {
AddGeneratorCommand_1.AddGeneratorCommand.exec()
.then(() => AddSeederCommand_1.AddSeederCommand.exec())
.then(() => AddModelCommand_1.AddModelCommand.exec())
.then(resolve)
.catch(reject);
});
}
}
exports.AddForCommand = AddForCommand;
//# sourceMappingURL=AddForCommand.js.map