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
118 lines (87 loc) • 2.67 kB
JavaScript
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 _consumer() {
const data = require("../../../api/consumer");
_consumer = function () {
return data;
};
return data;
}
function _logger() {
const data = _interopRequireDefault(require("../../../logger/logger"));
_logger = function () {
return data;
};
return data;
}
function _checkVersionCompatibility() {
const data = require("../../../scope/network/check-version-compatibility");
_checkVersionCompatibility = 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 Delete {
constructor() {
(0, _defineProperty2().default)(this, "name", '_delete <path> <args>');
(0, _defineProperty2().default)(this, "private", true);
(0, _defineProperty2().default)(this, "internal", true);
(0, _defineProperty2().default)(this, "description", 'remove a component from a scope');
(0, _defineProperty2().default)(this, "alias", '');
(0, _defineProperty2().default)(this, "opts", []);
}
action([path, args]) {
const {
payload,
headers
} = (0, _utils().unpackCommand)(args);
compressResponse = (0, _clientSupportCompressedCommand().default)(headers.version);
(0, _checkVersionCompatibility().checkVersionCompatibilityOnTheServer)(headers.version);
_logger().default.info('Checking if a migration is needed');
const scopePath = (0, _utils().fromBase64)(path);
return (0, _consumer().migrate)(scopePath, false).then(() => {
return (0, _scope().remove)({
path: scopePath,
ids: payload.bitIds,
force: payload.force
}, headers);
});
}
report(str) {
return (0, _utils().packCommand)((0, _utils().buildCommandMessage)(str, undefined, compressResponse), true, compressResponse);
}
}
exports.default = Delete;
;