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

var argv = require('minimist')(process.argv.slice(2));
var fs = require('fs');
var path = require('path');
var lib = require('../lib');
var config = {};

if (argv._.length === 0) {
  console.error('Usage: project-badge [-b badgefile] [options]');
  process.exit(1);
}

var outstream = fs.createWriteStream(path.join(process.cwd(), argv._[0]));

if (argv.b) {
  var configData = fs.readFileSync(path.join(process.cwd(), argv.b));
  config = JSON.parse(configData.toString());
}

for (var i in argv) {
  if (argv.hasOwnProperty(i) && i !== 'b' && i !== '_')
    config[i] = argv[i];
}

lib.outputToStream(config.type, config, outstream);<commit_msg>use resolve instead of join<commit_after>#!/usr/bin/env node

var argv = require('minimist')(process.argv.slice(2));
var fs = require('fs');
var path = require('path');
var lib = require('../lib');
var config = {};

if (argv._.length === 0) {
  console.error('Usage: project-badge [-b badgefile] [options]');
  process.exit(1);
}

var outstream = fs.createWriteStream(path.resolve(process.cwd(), argv._[0]));

if (argv.b) {
  var configData = fs.readFileSync(path.resolve(process.cwd(), argv.b));
  config = JSON.parse(configData.toString());
}

for (var i in argv) {
  if (argv.hasOwnProperty(i) && i !== 'b' && i !== '_')
    config[i] = argv[i];
}

lib.outputToStream(config.type, config, outstream);
{'fraction_non_alphanumeric': 0.21356421356421357, 'fraction_numerical': 0.005772005772005772, 'mean_word_length': 4.615384615384615, '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': '6285834', 'n_tokens_mistral': 503, 'n_tokens_neox': 498, 'n_words': 107}