UNPKG

@boostercloud/cli

Version:

CLI of the Booster Framework, the next level of abstraction for cloud-native applications

19 lines (18 loc) 846 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const core_1 = require("@oclif/core"); const project_checker_1 = require("../services/project-checker"); const logger_1 = require("../services/logger"); class BaseCommand extends core_1.Command { async init() { await (0, project_checker_1.checkCurrentDirBoosterVersion)(this.config.version); } async catch(fullError) { const errorMessage = fullError.message.split('\n')[0].replace('Error:', ''); const logRefMessage = '\n(You can see the full error logs in ./errors.log)'; const errorForFile = `\nboost ${this.id} ${this.argv.join(' ')}\n${fullError.message}`; (0, logger_1.appendOnErrorsFile)(errorForFile); return super.catch(new Error(errorMessage + logRefMessage)); } } exports.default = BaseCommand;