<commit_before>'use strict';

var renderer = require('cef-renderer'),
    spawn = require('child_process').spawn;
    path = require('path');


var RendererBrowser = function (baseBrowserDecorator, processLauncher) {
  var that = this;

  baseBrowserDecorator(this);
  
  this._getOptions = function(url) {
    return [
      '-logtostderr',
      '-url', url,
    ];
  };

  this._execCommand = function(cmd, args) {
    if (!cmd) {
      console.log('No binary for ' + this.name + ' browser on your platform.\n  ' +
                'Please, set "' + this.ENV_CMD + '" env variable.');

      this._retryLimit = -1; // disable restarting

      return this._clearTempDirAndReportDone('no binary');
    }

    cmd = this._normalizeCommand(cmd);

    console.log(cmd + ' ' + args.join(' '));
    this._process = spawn(cmd, args, {
      cwd: path.dirname(renderer.karma),
    });

    var errorOutput = '';

    this._process.on('close', function(code) {
      that._onProcessExit(code, errorOutput);
    });

    this._process.on('error', function(err) {
      if (err.code === 'ENOENT') {
        that._retryLimit = -1;
        errorOutput = 'Can not find the binary ' + cmd + '\n\t' +
                      'Please set env variable ' + that.ENV_CMD;
      } else {
        errorOutput += err.toString();
      }
    });

    // Node 0.8 does not emit the error
    if (process.versions.node.indexOf('0.8') === 0) {
      this._process.stderr.on('data', function(data) {
        var msg = data.toString();

        if (msg.indexOf('No such file or directory') !== -1) {
          that._retryLimit = -1;
          errorOutput = 'Can not find the binary ' + cmd + '\n\t' +
                        'Please set env variable ' + that.ENV_CMD;
        } else {
          errorOutput += msg;
        }
      });
    }
  };
};

RendererBrowser.$inject = ['baseBrowserDecorator'];


RendererBrowser.prototype = {
  name: 'Renderer',

  DEFAULT_CMD: {
    linux: renderer.karma,
  },
  ENV_CMD: 'RENDERER_BIN',
};


module.exports = {
  'launcher:Renderer': ['type', RendererBrowser]
};<commit_msg>Remove the personal command and use bash instead.<commit_after>'use strict';

var renderer = require('cef-renderer'),
    path = require('path');


var RendererBrowser = function (baseBrowserDecorator, processLauncher) {
  baseBrowserDecorator(this);

  var dir = path.dirname(renderer.karma);
  this._getOptions = function(url) {
    return [
      '-c',
      'LD_LIBRARY_PATH=' + dir + ' ' + renderer.karma +
          ' -logtostderr -url "' + url + '"',
    ];
  };
};

RendererBrowser.$inject = ['baseBrowserDecorator'];


RendererBrowser.prototype = {
  name: 'Renderer',

  DEFAULT_CMD: {
    linux: '/bin/sh',
  },
  ENV_CMD: 'RENDERER_BIN',
};


module.exports = {
  'launcher:Renderer': ['type', RendererBrowser]
};
{'fraction_non_alphanumeric': 0.15671641791044777, 'fraction_numerical': 0.0031982942430703624, 'mean_word_length': 2.5859872611464967, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2901516', 'n_tokens_mistral': 920, 'n_tokens_neox': 893, 'n_words': 188}