"use strict";

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

var _path = require("path");

var _os = require("os");

var _fs = require("fs");

var _constants = require("../constants");

const isWindows = (0, _os.platform)().toLowerCase() === 'win32';

const _getCliPath = libName => (0, _path.join)(_constants.cliNodeModulesPath, '.bin', libName);

const suffixExt = isWindows ? '.cmd' : '';

function getCliPath(libName) {
  const cliPath = _getCliPath(libName + suffixExt);

  return (0, _fs.existsSync)(cliPath) ? cliPath : libName + suffixExt;
}