@megaorm/cli
Version:
This package allows you to communicate with MegaORM via commands directly from the command line interface (CLI).
29 lines • 1.08 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.VersionCommand = void 0;
const path_1 = __importDefault(require("path"));
const MegaCommand_1 = require("../MegaCommand");
const config_1 = require("@megaorm/config");
/**
* Command that outputs the current version of the application.
*
*
* @extends MegaCommand
*/
class VersionCommand extends MegaCommand_1.MegaCommand {
/**
* Logs the current version of the application to the console.
*/
static exec() {
return new Promise((resolve, reject) => {
config_1.Config.loadJSON(path_1.default.resolve(__dirname, '../../package.json'))
.then((config) => resolve(this.warning(config.version)))
.catch(() => reject(new MegaCommand_1.MegaCommandError('Falied to load package.json')));
});
}
}
exports.VersionCommand = VersionCommand;
//# sourceMappingURL=VersionCommand.js.map