UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

77 lines (57 loc) 1.84 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _defineProperty2() { const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); _defineProperty2 = function () { return data; }; return data; } function _scope() { const data = require("../../../api/scope"); _scope = function () { return data; }; return data; } function _utils() { const data = require("../../../utils"); _utils = function () { return data; }; return data; } function _clientSupportCompressedCommand() { const data = _interopRequireDefault(require("../../../utils/ssh/client-support-compressed-command")); _clientSupportCompressedCommand = function () { return data; }; return data; } let compressResponse; class Prepare { constructor() { (0, _defineProperty2().default)(this, "name", '_scope <path> <args>'); (0, _defineProperty2().default)(this, "description", 'describe a scope'); (0, _defineProperty2().default)(this, "private", true); (0, _defineProperty2().default)(this, "internal", true); (0, _defineProperty2().default)(this, "alias", ''); (0, _defineProperty2().default)(this, "opts", []); } action([path, args]) { const { headers } = (0, _utils().unpackCommand)(args); compressResponse = (0, _clientSupportCompressedCommand().default)(headers.version); return (0, _scope().describeScope)((0, _utils().fromBase64)(path)); } report(scopeObj) { if ((0, _utils().empty)(scopeObj)) return ''; return (0, _utils().packCommand)((0, _utils().buildCommandMessage)(scopeObj, undefined, compressResponse), true, compressResponse); } } exports.default = Prepare;