"use strict";

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

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

function _path() {
  const data = _interopRequireDefault(require("path"));

  _path = function () {
    return data;
  };

  return data;
}

function _scope() {
  const data = _interopRequireDefault(require("./scope"));

  _scope = function () {
    return data;
  };

  return data;
}

function _utils() {
  const data = require("../utils");

  _utils = function () {
    return data;
  };

  return data;
}

function loadScope(currentPath) {
  if (!currentPath) currentPath = process.cwd();

  try {
    return _scope().default.load(_path().default.resolve((0, _utils().resolveHomePath)(currentPath)));
  } catch (err) {
    return Promise.reject(err);
  }
}