<commit_before>/**
 * Created by dsky on 2016/12/22.
 */

// get filePath
const fs = require('fs');

const filePath = JSON.parse(fs.readFileSync('./file.json', 'utf8'));
const buildSass = filePath.build.sass;
const buildCss = filePath.build.css;
const buildEs6 = filePath.build.es6;
const buildJs = filePath.build.js;
const buildIcon = filePath.build.icon;
const buildImg = filePath.build.img;
const distCss = filePath.dist.css;
const distImg = filePath.dist.img;
const distJs = filePath.dist.js;
<commit_msg>add creat floder fun<commit_after>/**
 * Created by dsky on 2016/12/22.
 */

// get filePath
const fs = require('fs'),
    path = require('path');

const filePath = JSON.parse(fs.readFileSync('./file.json', 'utf8'));
const buildSass = filePath.build.sass,
    buildCss = filePath.build.css,
    buildEs6 = filePath.build.es6,
    buildJs = filePath.build.js,
    buildIcon = filePath.build.icon,
    buildImg = filePath.build.img,
    distCss = filePath.dist.css,
    distImg = filePath.dist.img,
    distJs = filePath.dist.js;

// mkdir fun
const mkdirSync = function (path) {
    if(path){
        try {
            fs.mkdirSync(path);
        } catch(e) {
            if ( e.code != 'EEXIST' ) throw e;
        }
    }
};

const mkdirpSync = function (dirpath) {
    if(dirpath){
        const parts = dirpath.split(path.sep);
        const len = parts.length;
        for( let i = 1; i <= len ; i++ ) {
            mkdirSync( path.join.apply(null, parts.slice(0, i)) );
        }
    }
};
// creat floder
mkdirpSync(buildSass);
mkdirpSync(buildCss);
mkdirpSync(buildEs6);
mkdirpSync(buildJs);
mkdirpSync(buildIcon);
mkdirpSync(buildImg);
mkdirpSync(distCss);
mkdirpSync(distImg);
mkdirpSync(distJs);
{'fraction_non_alphanumeric': 0.1466121495327103, 'fraction_numerical': 0.014602803738317757, 'mean_word_length': 3.178048780487805, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2083285', 'n_tokens_mistral': 631, 'n_tokens_neox': 606, 'n_words': 129}