<commit_before>#!/usr/bin/env node
'use strict';
const opn = require('opn');
const pjson = require('./package.json');
let keyword = process.argv[1];

if (keyword == "open") {
	keyword = process.argv[2];
}


if (keyword == "bugs" || keyword == "issues") {
	opn(pjson.bugs.url);
} else if (keyword == "home" || keyword == "homepage") {
	opn(pjson.homepage);
}

// Get current directory where this was run
// console.log(process.cwd());<commit_msg>Fixing bugs, and reogranizing code<commit_after>#!/usr/bin/env node
'use strict';
const opn = require('opn');
const path = require('path');
try {
	require(path.join(process.cwd(), 'package.json'));
} catch (e) {
	console.error("Can't find package.json file.");
	process.exit(1);
}
const pjson = require(path.join(process.cwd(), 'package.json'));
const argvs = process.argv;
const parsedParams = allElementsAfter("hubbot", argvs); // ex. ['hubbot', 'bugs']
const keyword = parsedParams[1]; // ex. 'bugs'

console.log(argvs);
console.log(parsedParams);
console.log(keyword);


if (keyword == "bugs" || keyword == "issues") {
	opn(pjson.bugs.url);
} else if (keyword == "home" || keyword == "homepage") {
	opn(pjson.homepage);
}

// Get current directory where this was run
console.log(process.cwd());


function allElementsAfter(keyword, array) {
	let pastValue = false;
	let newArray = [];
	array.forEach(function (element) {
		if (element == keyword) {
			pastValue = true;
		}
		if (pastValue) {
			newArray.push(element);
		}
	});
	return newArray;
}

process.exit();
{'fraction_non_alphanumeric': 0.19088507265521795, 'fraction_numerical': 0.002642007926023778, 'mean_word_length': 4.631970260223048, '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': '6007527', 'n_tokens_mistral': 544, 'n_tokens_neox': 522, 'n_words': 126}