"use strict";

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

var _child_process = require("child_process");

function getCWD() {
  // require("child_process").
  let cwd = process.cwd();

  try {
    let ress = (0, _child_process.execSync)('npm bin').toString();
    let i = ress.lastIndexOf('node_modules');
    cwd = i === -1 ? cwd : ress.slice(0, i);
  } catch (error) {
    console.log(error);
  }

  return cwd;
}