function exec (cmd, userOptions) {
    if (cmd instanceof Array) {
      return cmd.map(function (cmd) { return exec(cmd, userOptions); });
    }
    try {
      const options = Object.create(defaultOptions);
      for (const key in userOptions) options[ key ] = userOptions[ key ];
      return child_process.execSync(cmd + ' 2> /dev/null', options).toString().trim();
    } catch (err) {
      return err;
    }
  }
utility method for executing terminal commands while ignoring stderr
@param {string|Array} cmd
@param {Object=} userOptions
@return