"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

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

function globalConfig() {
  const data = _interopRequireWildcard(require("../../api/consumer/lib/global-config"));

  globalConfig = function () {
    return data;
  };

  return data;
}

function _constants() {
  const data = require("../../constants");

  _constants = function () {
    return data;
  };

  return data;
}

function shouldShowInteractive(commandConfigName) {
  const specificCommandConfig = globalConfig().getSync(commandConfigName); // we use (specificCommandConfig !== 'false') rather than (specificCommandConfig === 'true') to make it true in case of
  // wrong value

  if (specificCommandConfig !== undefined) return specificCommandConfig !== 'false';
  const generalInteractiveConfig = globalConfig().getSync(_constants().CFG_INTERACTIVE);
  if (generalInteractiveConfig !== undefined) return generalInteractiveConfig !== 'false'; // Default is to show interactive

  return true;
}