lambdaorm-cli
Version:
The lambdaorm command line interface
33 lines • 1.63 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CliFacade = void 0;
class CliFacade {
// eslint-disable-next-line no-useless-constructor
constructor(languages, orm, workspace, output, helper, schema) {
this.languages = languages;
this.orm = orm;
this.workspace = workspace;
this.output = output;
this.helper = helper;
this.schema = schema;
}
getGlobalPackage(name) {
return __awaiter(this, void 0, void 0, function* () {
const exp = new RegExp(`${name}@(.*)\n`);
const globalNpmList = yield this.helper.utils.exec('npm list -g --depth=0', process.cwd());
const globalMatches = globalNpmList.match(exp);
return (globalMatches && globalMatches[1] ? globalMatches[1] : '').replace(/"invalid"/gi, '').trim();
});
}
}
exports.CliFacade = CliFacade;
//# sourceMappingURL=cli.js.map