<commit_before>import path from 'path';
import child_process from 'child_process';

const forkFile = path.join(__dirname, 'accelerator.js');

// could also check argv[0/1] if this is a problem
const meteorToolPath = process.env.OLDPWD;

class Accelerator {

  constructor(port, id) {
    this.listeners = [];

    this.child = child_process.fork(forkFile, [id, port, meteorToolPath]);

    this.child.on('message', (msg) => {<commit_msg>Use argv instead of OLDPWD to figure out meteorToolsPath (#56)<commit_after>import path from 'path';
import child_process from 'child_process';

const forkFile = path.join(__dirname, 'accelerator.js');

// We can figure this out from the path of the node bin being called
// /home/dragon/.meteor/packages/meteor-tool/.1.3.2_1.1b63asg++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node
const meteorToolPath = path.join(
  path.dirname(process.argv[0]),  // bin (from bin/node)
  '..',                           // dev_bundle
  '..'                            // meteorToolPath
);

class Accelerator {

  constructor(port, id) {
    this.listeners = [];

    this.child = child_process.fork(forkFile, [id, port, meteorToolPath]);

    this.child.on('message', (msg) => {
{'fraction_non_alphanumeric': 0.14019448946515398, 'fraction_numerical': 0.01620745542949757, 'mean_word_length': 3.4265232974910393, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6852907', 'n_tokens_mistral': 435, 'n_tokens_neox': 399, 'n_words': 93}