<commit_before>var rimraf = require('rimraf');
var utils  = require('amd-utils');
var async  = require('async');
var glob   = require('glob');

var task = {
    id         : 'rm',
    author     : 'Indigo United',
    name       : 'Remove',
    description: 'Remove files',
    options: {
        files: {
            description: 'The files or directories to remove. Accepts an array of entries or a single one through a string. Works with minimatch.'
        },
        glob: {
            description: 'The options to pass to glob (please look the available options in the glob package README)',
            'default': {
                dot: true
            }
        }
    },
    tasks      :
    [
        {
            task: function (opt, next) {
                // TODO: optimize this with the expand function
                var files = utils.lang.isArray(opt.files) ? opt.files : [opt.files];

                async.forEach(files, function (file, next) {
                    glob(file, opt.glob, function (err, matches) {
                        if (err) {
                            return next(err);
                        }

                        async.forEach(matches, function (match) {
                            rimraf(match, next);<commit_msg>Fix rm calling next too soon.<commit_after>var rimraf = require('rimraf');
var utils  = require('amd-utils');
var async  = require('async');
var glob   = require('glob');

var task = {
    id         : 'rm',
    author     : 'Indigo United',
    name       : 'Remove',
    description: 'Remove files',
    options: {
        files: {
            description: 'The files or directories to remove. Accepts an array of entries or a single one through a string. Works with minimatch.'
        },
        glob: {
            description: 'The options to pass to glob (please look the available options in the glob package README)',
            'default': {
                dot: true
            }
        }
    },
    tasks      :
    [
        {
            task: function (opt, next) {
                // TODO: optimize this with the expand function
                var files = utils.lang.isArray(opt.files) ? opt.files : [opt.files];

                async.forEach(files, function (file, next) {
                    glob(file, opt.glob, function (err, matches) {
                        if (err) {
                            return next(err);
                        }

                        async.forEach(matches, function (match, next) {
                            rimraf(match, next);
{'fraction_non_alphanumeric': 0.10328638497652583, 'fraction_numerical': 0.0, 'mean_word_length': 1.4352380952380952, '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': '46030', 'n_tokens_mistral': 654, 'n_tokens_neox': 635, 'n_words': 213}