'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _createSymlinkOrCopy;

function _load_createSymlinkOrCopy() {
  return _createSymlinkOrCopy = _interopRequireDefault(require('../utils/fs/create-symlink-or-copy'));
}

var _bitId;

function _load_bitId() {
  return _bitId = _interopRequireDefault(require('../bit-id/bit-id'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Symlink = function () {
  // current existing path
  function Symlink(src, dest, componentId) {
    _classCallCheck(this, Symlink);

    this.src = src;
    this.dest = dest;
    this.componentId = componentId;
  } // new symlink path


  _createClass(Symlink, [{
    key: 'write',
    value: function write() {
      return (0, (_createSymlinkOrCopy || _load_createSymlinkOrCopy()).default)(this.src, this.dest, this.componentId ? this.componentId.toString() : null);
    }
  }], [{
    key: 'makeInstance',
    value: function makeInstance(src, dest, componentId) {
      return new Symlink(src, dest, componentId);
    }
  }]);

  return Symlink;
}();

exports.default = Symlink;