"use strict";

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

var _getCliPath = require("./getCliPath");

const {
  spawnSync,
  spawn
} = require('child_process');

function spawnSyncIO(commandName, args) {
  const command = (0, _getCliPath.getCliPath)(commandName);
  const result = spawnSync(command, args, {
    stdio: 'inherit'
  });

  if (result.error || result.stderr) {
    console.error(result.error || result.stderr);
  } // console.log(result.output);


  process.exit(result.status);
}

function spawnIO(commandName, args, cb) {
  // const result =
  spawn(commandName, args, {
    stdio: 'inherit'
  }, cb); // process.exit(result.status);
}