<commit_before>var async = require('async');
var exec = require('child_process').exec;
var NodeRunner = require('../src/RunWrappers/Node');
var CmdHelper = require('../src/CmdHelper');
var RunListHelper = require('../src/RunListHelper');
var _ = require('lodash');
var green = '\u001b[42m \u001b[0m';
var red = '\u001b[41m \u001b[0m';

module.exports = {
  name: 'install',
  description: 'Runs npm install against all repos',
  usage: '[-r <repoPattern>]',
  requiresNvm: true,
};

function install(bosco, progressbar, bar, repoPath, repo, next) {
  var packageJson = [repoPath, 'package.json'].join('/');
  if (!bosco.exists(packageJson)) {
    if (progressbar) bar.tick();
    return next();
  }

  var yarnrcFile = [repoPath, '.yarnrc'].join('/');
  var yarnLockFile = [repoPath, 'yarn.lock'].join('/');
  if (bosco.exists(yarnrcFile) || bosco.exists(yarnLockFile)) {
    var yarnComamnd = 'yarn';
    if (bosco.config.get('npm:registry')) {
      yarnComamnd = 'yarn config set registry ' + bosco.config.get('npm:registry') + '; ' + yarnComamnd;
    }
    exec(yarnComamnd, {
      cwd: repoPath,
    }, function(err, stdout, stderr) {
      if (progressbar) bar.tick();
      if (err) {
        if (progressbar) bosco.console.log('');
        bosco.error(repoPath.blue + ' >> ' + stderr);
      } else {
        if (!progressbar) {
          if (!stdout) {
            bosco.log('Yarn install for ' + repoPath.blue + ': ' + 'No changes'.green);
          } else {
            bosco.log('Yarn install for ' + repoPath.blue);
            bosco.console.log(stdout);
            if (stderr) {
              bosco.error(stderr);
            }
          }
        }
      }
      next();
    });
  } else {
    NodeRunner.getInterpreter(bosco, {name: repo, cwd: repoPath}, function(err, interpreter) {
      if (err) {
        bosco.error(err);
        return next();
      }
      var npmCommand;
      if (interpreter) {<commit_msg>Rely only on .yarnrc or global yarn config - ignore bosco npm registry config<commit_after>var async = require('async');
var exec = require('child_process').exec;
var NodeRunner = require('../src/RunWrappers/Node');
var CmdHelper = require('../src/CmdHelper');
var RunListHelper = require('../src/RunListHelper');
var _ = require('lodash');
var green = '\u001b[42m \u001b[0m';
var red = '\u001b[41m \u001b[0m';

module.exports = {
  name: 'install',
  description: 'Runs npm install against all repos',
  usage: '[-r <repoPattern>]',
  requiresNvm: true,
};

function install(bosco, progressbar, bar, repoPath, repo, next) {
  var packageJson = [repoPath, 'package.json'].join('/');
  if (!bosco.exists(packageJson)) {
    if (progressbar) bar.tick();
    return next();
  }

  var yarnrcFile = [repoPath, '.yarnrc'].join('/');
  var yarnLockFile = [repoPath, 'yarn.lock'].join('/');
  if (bosco.exists(yarnrcFile) || bosco.exists(yarnLockFile)) {
    var yarnComamnd = 'yarn';
    exec(yarnComamnd, {
      cwd: repoPath,
    }, function(err, stdout, stderr) {
      if (progressbar) bar.tick();
      if (err) {
        if (progressbar) bosco.console.log('');
        bosco.error(repoPath.blue + ' >> ' + stderr);
      } else {
        if (!progressbar) {
          if (!stdout) {
            bosco.log('Yarn install for ' + repoPath.blue + ': ' + 'No changes'.green);
          } else {
            bosco.log('Yarn install for ' + repoPath.blue);
            bosco.console.log(stdout);
            if (stderr) {
              bosco.error(stderr);
            }
          }
        }
      }
      next();
    });
  } else {
    NodeRunner.getInterpreter(bosco, {name: repo, cwd: repoPath}, function(err, interpreter) {
      if (err) {
        bosco.error(err);
        return next();
      }
      var npmCommand;
      if (interpreter) {
{'fraction_non_alphanumeric': 0.1689171299973524, 'fraction_numerical': 0.009531374106433678, 'mean_word_length': 2.6326923076923077, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '724030', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1260, 'n_words': 273}