@veecode-platform/safira-cli
Version:
Generate a microservice project from your spec.
31 lines (30 loc) • 1.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RitchieCommand = void 0;
const tslib_1 = require("tslib");
const file_system_utils_1 = require("../utils/file-system-utils");
const install_vkpr_1 = require("../vkpr/install-vkpr");
const command_execute_1 = require("../command/command-execute");
const properties = tslib_1.__importStar(require("../properties.json"));
class RitchieCommand {
constructor() { }
async run(command) {
await command_execute_1.CommandExecute.instance.runInteractive(command);
}
async runWithResponse(command) {
return command_execute_1.CommandExecute.instance.exec(`${await this._loadVkpr()} ${command}`, false);
}
async _loadVkpr() {
if (!file_system_utils_1.FileSystemUtils.commandExists(properties.ritchie["bin-name"])) {
await install_vkpr_1.InstallVkpr.instance.install();
}
return properties.ritchie["bin-name"];
}
static get instance() {
if (!this._instance) {
this._instance = new this();
}
return this._instance;
}
}
exports.RitchieCommand = RitchieCommand;