<commit_before>const fs = require('fs');
const path = require('path');
const asyncLib = require('async');

const Compiler = require('./Compiler');

class Zsh extends Compiler {
    concatFiles(files, callback) {
        asyncLib.map(files, fs.readFile, (err, arr) => {
            if (err) return callback(err);
            callback(null, arr.join(''));
        });
    }

    listZshrcSourceFiles(callback) {
        const zshrcSourceDir = this.options.zshrc.sourceDir;
        fs.readdir(zshrcSourceDir, (err, files) => {
            if (err) return callback(err);
            const getFilePath = asyncLib.asyncify(path.join.bind(null, zshrcSourceDir));
            asyncLib.map(files, getFilePath, callback);
        });
    }

    writeZshRc(data, callback) {
        const zshrc = path.join(this.options.zdotdir, '.zshrc');
        fs.writeFile(zshrc, data, callback);
    }

    renderZshrc(callback) {
        asyncLib.seq(
            this.listZshrcSourceFiles,
            this.concatFiles,
            this.writeZshRc
        ).call(this, callback);
    }

    run(callback) {
        this.renderZshrc(callback);
    }
}<commit_msg>Bind path.join's this to null doesn't look correct<commit_after>const fs = require('fs');
const path = require('path');
const asyncLib = require('async');

const Compiler = require('./Compiler');

class Zsh extends Compiler {
    concatFiles(files, callback) {
        asyncLib.map(files, fs.readFile, (err, arr) => {
            if (err) return callback(err);
            callback(null, arr.join(''));
        });
    }

    listZshrcSourceFiles(callback) {
        const zshrcSourceDir = this.options.zshrc.sourceDir;
        fs.readdir(zshrcSourceDir, (err, files) => {
            if (err) return callback(err);
            asyncLib.map(files, (file, mapCb) => {
                mapCb(null, path.join(zshrcSourceDir, file));
            }, callback);
        });
    }

    writeZshRc(data, callback) {
        const zshrc = path.join(this.options.zdotdir, '.zshrc');
        fs.writeFile(zshrc, data, callback);
    }

    renderZshrc(callback) {
        asyncLib.seq(
            this.listZshrcSourceFiles,
            this.concatFiles,
            this.writeZshRc
        ).call(this, callback);
    }

    run(callback) {
        this.renderZshrc(callback);
    }
}
{'fraction_non_alphanumeric': 0.13563714902807775, 'fraction_numerical': 0.0, 'mean_word_length': 2.341991341991342, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '3126718', 'n_tokens_mistral': 734, 'n_tokens_neox': 719, 'n_words': 135}