"use strict";

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

var _runPreProcess = require("../../shared/pre_process/runPreProcess");

function commandExecutor(options) {
  const {
    extraArgs = []
  } = options;
  const index = extraArgs.indexOf('-w');
  const canWatch = index !== -1;
  const result = (0, _runPreProcess.runPreProcess)(options, canWatch ? 'nodemon' : 'node');
  !canWatch && process.exit(result ? result.status : 0);
}