<commit_before>#!/usr/bin/env node

var call = require('../lib/index').call;
try {
  var pkg = require(process.cwd() + '/package.json') || {};
} catch (e) {

}


try {
  console.log('Requiring babel-register...')
  if (pkg.runjs && pkg.runjs['babel-register']) {
    require(process.cwd() + pkg.runjs['babel-register']);
  } else {
    require(process.cwd() + '/node_modules/babel-register');
  }
} catch (e) {
  console.log('Requiring failed. Fallback to pure node.')
}

console.log('Processing runfile...')
var runfile = require(process.cwd() + '/runfile');
call(runfile, process.argv.slice(2));<commit_msg>run script: using path.resolve<commit_after>#!/usr/bin/env node

var call = require('../lib/index').call;
var path = require('path');

// try to read package.json config
try {
  var pkg = require(path.resolve('./package.json')) || {};
} catch (e) {

}

// try to load babel-register
try {
  console.log('Requiring babel-register...')
  if (pkg.runjs && pkg.runjs['babel-register']) {
    require(path.resolve(pkg.runjs['babel-register']));
  } else {
    require(path.resolve('./node_modules/babel-register'));
  }
} catch (e) {
  console.log('Requiring failed. Fallback to pure node.')
}

// process runfile.js
console.log('Processing runfile...')
var runfile = require(path.resolve('./runfile'));
call(runfile, process.argv.slice(2));
{'fraction_non_alphanumeric': 0.20520446096654274, 'fraction_numerical': 0.001486988847583643, 'mean_word_length': 3.9667896678966788, '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': '1908522', 'n_tokens_mistral': 473, 'n_tokens_neox': 462, 'n_words': 90}