"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _child_process = require("child_process");

var _log = require("./log");

var _default = (type = 'git', branchName) => new Promise(resolve => {
  if (type === 'git') {
    (0, _child_process.spawnSync)('git', ['pull', 'origin', branchName], {
      encoding: 'utf8'
    });
    (0, _log.log)(branchName, 'Branch Pulled!');
    resolve();
  } else if (type === 'hg') {
    (0, _child_process.spawnSync)('hg', ['pull'], {
      encoding: 'utf8'
    });
    (0, _log.log)(branchName, 'Branch Pulled!');
    resolve();
  }
});

exports.default = _default;