"use strict";

var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

_Object$defineProperty(exports, "__esModule", {
  value: true
});

exports.default = _default;

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));

var _gitBranch = _interopRequireDefault(require("git-branch"));

var _getPackageVersions = _interopRequireDefault(require("../utils/getPackageVersions"));

var _getCurrentVersion = _interopRequireDefault(require("../utils/getCurrentVersion"));

var _getPackageNugetName = _interopRequireDefault(require("../utils/getPackageNugetName"));

function _default(_x, _x2, _x3, _x4) {
  return _ref.apply(this, arguments);
}

function _ref() {
  _ref = (0, _asyncToGenerator2.default)(function* (nugetPackageName, repo, apiKey, allowRelease) {
    const currentBranch = yield (0, _gitBranch.default)();
    const currentVersion = (0, _getCurrentVersion.default)();
    const appName = nugetPackageName || (0, _getPackageNugetName.default)();
    const newVersion = yield (0, _getPackageVersions.default)(appName, currentVersion, currentBranch, repo, apiKey, allowRelease);
    return newVersion;
  });
  return _ref.apply(this, arguments);
}

module.exports = exports.default;