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
68 lines (52 loc) • 1.25 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _bluebird() {
const data = require("bluebird");
_bluebird = function () {
return data;
};
return data;
}
function _consumer() {
const data = require("../../../consumer");
_consumer = function () {
return data;
};
return data;
}
function _moveComponents() {
const data = require("../../../consumer/component-ops/move-components");
_moveComponents = function () {
return data;
};
return data;
}
var _default = /*#__PURE__*/function () {
var _move = (0, _bluebird().coroutine)(function* ({
from,
to,
component
}) {
const consumer = yield (0, _consumer().loadConsumer)();
let moveResults;
if (component) {
const id = consumer.getParsedId(from);
moveResults = yield (0, _moveComponents().moveExistingComponentFilesToOneDir)(consumer, id, to);
} else {
moveResults = yield (0, _moveComponents().movePaths)(consumer, {
from,
to
});
}
yield consumer.onDestroy();
return moveResults;
});
function move(_x) {
return _move.apply(this, arguments);
}
return move;
}();
exports.default = _default;
;