<commit_before>var fs = require('fs');
var exec = require('child_process').exec;
var path = require('path');
var write = require('./util').write;


// build custom/*
if (!fs.existsSync('themes.json') && !fs.existsSync('custom')) {
    return write('themes.json', '{}');
}

if (!fs.existsSync('custom')) {
    return;
}

var themes = {};

fs.readdirSync('custom').filter(file => path.join('custom', file).match(/\.less$/)).forEach(theme => {

    theme = path.basename(theme, '.less');

    themes[theme] = {file: `../css/uikit.${theme}.css`};

    exec(`lessc --relative-urls --rootpath=../custom/ custom/${theme}.less > css/uikit.${theme}.css`, () => {
        console.log(`${'css/uikit.'+theme+'.css'} build`);
    });
});

if (Object.keys(themes).length) {
    write('themes.json', JSON.stringify(themes));
}<commit_msg>output less errors compiling custom themes<commit_after>var fs = require('fs');
var exec = require('child_process').exec;
var path = require('path');
var write = require('./util').write;


// build custom/*
if (!fs.existsSync('themes.json') && !fs.existsSync('custom')) {
    return write('themes.json', '{}');
}

if (!fs.existsSync('custom')) {
    return;
}

var themes = {};

fs.readdirSync('custom').filter(file => path.join('custom', file).match(/\.less$/)).forEach(theme => {

    theme = path.basename(theme, '.less');

    themes[theme] = {file: `../css/uikit.${theme}.css`};

    exec(`lessc --relative-urls --rootpath=../custom/ custom/${theme}.less > css/uikit.${theme}.css`, (error, stdout, stderr) => {

        if (stderr) {
            console.log(`Error building: ${'css/uikit.'+theme+'.css'} `, stderr);
        } else {
            console.log(`${'css/uikit.'+theme+'.css'} build `);
        }
    });
});

if (Object.keys(themes).length) {
    write('themes.json', JSON.stringify(themes));
}
{'fraction_non_alphanumeric': 0.24331696672122205, 'fraction_numerical': 0.0, 'mean_word_length': 3.6313131313131315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6151427', 'n_tokens_mistral': 632, 'n_tokens_neox': 613, 'n_words': 103}