<commit_before>var program = require('commander');
var config = require('../package.json');

/**
 * Prepare the environment before run main program.
 * @param callback {Function}
 */
function bootstrap(callback) {
	// Make new created files writable by group members.
	if (process.setgid && process.getgid) {
		process.umask('002');
		process.setgid(parseInt(
			process.env['SUDO_GID'] || process.getgid(), 10));
	}

	callback();
}

if (module.parent) { // Use as a sub module.
	module.exports = bootstrap;
} else { // Use as a main module.
	bootstrap(function () {
		program
			.version(config.version)
			.usage('<command> [options]');
		program
			.command('run <path>')
			.description('Start a front service')
			.action(function (path) {
				var options = {};
				
				if (program.plugins) {
					options.plugins = program.plugins.split(',').map(function(plugin) {
						return /[^\w-]/i.test(plugin) ? path.resolve(plugin.trim()) : plugin;
					});
				}
				
				for (var i in require('./util').argv) {
					options[i] = program[i] || config[i];
				} 
				
				if (Array.isArray(config.ports)) {
					var port = options.port;
					config.ports.forEach(function(name) {
						options[name] = ++port;
					});
				}
				
				require(path)(options);
			});
	<commit_msg>bootstrap<commit_after>var program = require('commander');
var config = require('../package.json');

/**
 * Prepare the environment before run main program.
 * @param callback {Function}
 */
function bootstrap(callback) {
	// Make new created files writable by group members.
	if (process.setgid && process.getgid) {
		process.umask('002');
		process.setgid(parseInt(
			process.env['SUDO_GID'] || process.getgid(), 10));
	}

	callback();
}

if (module.parent) { // Use as a sub module.
	module.exports = bootstrap;
} else { // Use as a main module.
	bootstrap(function () {
		program
			.version(config.version)
			.usage('<command> [options]');
		program
			.command('run <path>')
			.description('Start a front service')
			.action(function (path) {
				var options = {};
				
				for (var i in require('./util').argv) {
					options[i] = program[i] || config[i];
				} 
				
				if (options.plugins) {
					options.plugins = options.plugins.split(',');
				}
				
				if (Array.isArray(config.ports)) {
					var port = options.port;
					config.ports.forEach(function(name) {
						options[name] = ++port;
					});
				}
				
				require(path)(options);
			});
	
{'fraction_non_alphanumeric': 0.17028243962341383, 'fraction_numerical': 0.004093327875562832, 'mean_word_length': 2.980456026058632, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5783660', 'n_tokens_mistral': 965, 'n_tokens_neox': 770, 'n_words': 178}