'use strict';

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

var _path;

function _load_path() {
  return _path = _interopRequireDefault(require('path'));
}

var _scope;

function _load_scope() {
  return _scope = _interopRequireDefault(require('./scope'));
}

var _utils;

function _load_utils() {
  return _utils = require('../utils');
}

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

function loadScope(currentPath) {
  if (!currentPath) currentPath = process.cwd();
  try {
    return (_scope || _load_scope()).default.load((_path || _load_path()).default.resolve((0, (_utils || _load_utils()).resolveHomePath)(currentPath)));
  } catch (err) {
    return Promise.reject(err);
  }
}