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

'use strict';

var fs = require('fs');
var crypto = require('crypto');
var path = require('path')

var dir = path.resolve(__dirname, '..', '.temp')

if (!fs.existsSync(dir)){
    fs.mkdirSync(dir);
}

if (!fs.existsSync('./twl.config.json')) {
    var token = crypto.randomBytes(32).toString('hex');
    var defaultConf = {
        token: token,
        projects: {}
    }
    fs.writeFileSync(path.join(__dirname, '../' + 'twl.config.json'), JSON.stringify(defaultConf))
}<commit_msg>fixed setup conf dir bug<commit_after>#! /usr/bin/env node

'use strict';

var fs = require('fs');
var crypto = require('crypto');
var path = require('path')

var dir = path.resolve(__dirname, '..', '.temp')

if (!fs.existsSync(dir)) {
    fs.mkdirSync(dir);
}

var confDir = path.join(__dirname, '../' + 'twl.config.json')

if (!fs.existsSync(confDir)) {
    var token = crypto.randomBytes(32).toString('hex');
    var defaultConf = {
        token: token,
        projects: {}
    }
    fs.writeFileSync(confDir, JSON.stringify(defaultConf))
}
{'fraction_non_alphanumeric': 0.19400187441424555, 'fraction_numerical': 0.0037488284910965324, 'mean_word_length': 3.5836909871244633, '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': '2072671', 'n_tokens_mistral': 365, 'n_tokens_neox': 359, 'n_words': 75}