<commit_before>var fs = require("fs");
var browserify = require("browserify");
var prependify = require("prependify");
var tinyifiy = require("tinyify");
var cpx = require("cpx");

var arg = process.argv[2];

if(arg === "clean") {
    dir = fs.readdirSync(__dirname + "/");
    var strayKittyIndex = dir.indexOf("straykitty.zip");
    var objIndex = dir.indexOf("obj");
    var distIndex = dir.indexOf("dist");
    if(strayKittyIndex > -1) {
        fs.unlinkSync(__dirname + "/straykitty.zip");
    }
    if(distIndex > -1) {
        var dir = fs.readdirSync(__dirname + "/dist");
        for(var i = 0; i < dir.length; i++){
            fs.unlinkSync(__dirname + "/dist/" + dir[i]);
        }
        fs.rmdirSync(__dirname + "/dist");
    }
    if(objIndex > -1) {
        dir = fs.readdirSync(__dirname + "/obj");
        for(var i = 0; i < dir.length; i++){
            fs.unlinkSync(__dirname + "/obj/" + dir[i]);
        }
        fs.rmdirSync(__dirname + "/obj");
    }
    console.log("all clean ;3");
    return;<commit_msg>Fix npm run clean<commit_after>var fs = require("fs");
var browserify = require("browserify");
var prependify = require("prependify");
var tinyifiy = require("tinyify");
var cpx = require("cpx");

var arg = process.argv[2];

function cleanFolder(folder, dir) {
    let folderDir = __dirname + "/" + folder;

    let files;
    try {
        files = fs.readdirSync(folderDir);
    } catch(e) {
        return;
    }

    console.log("enter "+folderDir);
    for(var i = 0; i < files.length; i++){
        let file =  __dirname + "/"+folder+"/" + files[i];
        console.log("unlink " + file);
        fs.unlinkSync(file);
    }

    console.log("rmdir " + folderDir);
    fs.rmdirSync(folder);
}

if(arg === "clean") {
    dir = fs.readdirSync(__dirname + "/");
    var strayKittyIndex = dir.indexOf("straykitty.zip");

    if(strayKittyIndex > -1) {
        console.log("unlink straykitty.zip");
        fs.unlinkSync(__dirname + "/straykitty.zip");
    }

    cleanFolder("dist", dir);
    cleanFolder("obj/actions", dir);
    cleanFolder("obj", dir);

    console.log("all clean ;3");
    return;
{'fraction_non_alphanumeric': 0.1794751640112465, 'fraction_numerical': 0.005154639175257732, 'mean_word_length': 2.7720848056537104, 'pattern_counts': {'":': 0, '<': 6, '<?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': '2589422', 'n_tokens_mistral': 728, 'n_tokens_neox': 713, 'n_words': 148}