<commit_before>'use strict';

var fs = require('fs');
var path = require('path');

var hopsConfig = require('hops-config');

var binDir = path.join(hopsConfig.appDir, 'node_modules', '.bin');

module.exports = function findCommands() {
  if (fs.existsSync(binDir)) {
    return fs
      .readdirSync(binDir)
      .filter(function(command) {
        return command.indexOf('hops-') === 0;
      })
      .map(function(command) {
        return path.join(binDir, command);
      })
      .concat(path.join(__dirname, '..', 'commands', 'start.js'));
  } else {
    return [];
  }
};
<commit_msg>fix(cli): use pkg-dir instead of hops-config to figure out app root<commit_after>'use strict';

var fs = require('fs');
var path = require('path');

var root = require('pkg-dir').sync();

var binDir = path.join(root, 'node_modules', '.bin');

module.exports = function findCommands() {
  if (fs.existsSync(binDir)) {
    return fs
      .readdirSync(binDir)
      .filter(function(command) {
        return command.indexOf('hops-') === 0;
      })
      .map(function(command) {
        return path.join(binDir, command);
      })
      .concat(path.join(__dirname, '..', 'commands', 'start.js'));
  } else {
    return [];
  }
};

{'fraction_non_alphanumeric': 0.18218954248366012, 'fraction_numerical': 0.0016339869281045752, 'mean_word_length': 3.1245791245791246, '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': '3923417', 'n_tokens_mistral': 404, 'n_tokens_neox': 396, 'n_words': 84}