<commit_before>/**
 * Created by axetroy on 17-2-14.
 */

const path = require('path');
const process = require('process');
const _ = require('lodash');
const Promise = require('bluebird');
const fs = Promise.promisifyAll(require('fs-extra'));
const prettyjson = require('prettyjson');
const log4js = require('log4js');
const logger = log4js.getLogger('LS');

const config = require('../config');

function *ls(options) {
  const lockJSON = yield fs.readJsonAsync(config.paths.lock);
  lockJSON.repos = lockJSON.repos || [];

  if (_.isEmpty(lockJSON.repos)) {
    logger.warn(`You did not add any repository yet, try run command line: ${config.name} add <repo> [options]`);
  } else {
    const result = {};
    lockJSON.repos.forEach(function (repo) {
      result[repo.source.red] = result[repo.source.red] || {};
      result[repo.source.red][repo.owner.yellow] = result[repo.source.red][repo.owner.yellow] || {};
      result[repo.source.red][repo.owner.yellow][repo.name] = repo.path.white;
    });
    let str = prettyjson.render({
      [path.join(process.env.HOME, config.defaults.base)]: result
    });
    process.stdout.write(prettyjson.render({
        [path.join(process.env.HOME, config.defaults.base)]: result
      }) + '\n');
  }
}

module.exports = function (options) {
  return ls(options);
};<commit_msg>refactor: remove unused code<commit_after>/**
 * Created by axetroy on 17-2-14.
 */

const path = require('path');
const process = require('process');
const _ = require('lodash');
const Promise = require('bluebird');
const fs = Promise.promisifyAll(require('fs-extra'));
const prettyjson = require('prettyjson');
const log4js = require('log4js');
const logger = log4js.getLogger('LS');

const config = require('../config');

function *ls(options) {
  const lockJSON = yield fs.readJsonAsync(config.paths.lock);
  lockJSON.repos = lockJSON.repos || [];

  if (_.isEmpty(lockJSON.repos)) {
    logger.warn(`You did not add any repository yet, try run command line: ${config.name} add <repo> [options]`);
  } else {
    const result = {};
    lockJSON.repos.forEach(function (repo) {
      result[repo.source.red] = result[repo.source.red] || {};
      result[repo.source.red][repo.owner.yellow] = result[repo.source.red][repo.owner.yellow] || {};
      result[repo.source.red][repo.owner.yellow][repo.name] = repo.path.white;
    });
    process.stdout.write(prettyjson.render({
        [path.join(process.env.HOME, config.defaults.base)]: result
      }) + '\n');
  }
}

module.exports = function (options) {
  return ls(options);
};
{'fraction_non_alphanumeric': 0.17872506843957764, 'fraction_numerical': 0.006257332811888932, 'mean_word_length': 4.055335968379446, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4510825', 'n_tokens_mistral': 836, 'n_tokens_neox': 807, 'n_words': 165}