<commit_before>const gulp = require('gulp');
const babel = require('gulp-babel');
const del = require('del');
const bump = require('gulp-bump');
const spawn = require('child_process').spawn;
const git = require('gulp-git');

['major', 'minor', 'patch'].forEach(function(version) {
    gulp.task(`bump:${version}`, function() {
        gulp.src('./package.json')
            .pipe(bump({ type: version }))
            .pipe(gulp.dest('./'));
    });

    gulp.task(`release:${version}`, [`bump:${version}`, 'tag:release', 'npm:publish']);
});

gulp.task('bump', ['bump:patch']);
gulp.task('release', ['build:dist', 'bump:patch', 'tag:release', 'npm:publish']);

gulp.task('tag:release', function(done) {
    var pkg = require('./package.json');
    var message = `Release ${pkg.version}`;

    return gulp.src('./')
        .pipe(git.add({ args: '-u' }))
        .pipe(git.commit(message))
        .pipe(git.tag(pkg.version, message))
        .pipe(git.push('origin', 'master', { args: '--tags' }))
        .pipe(gulp.dest('./'));
});

gulp.task('clean:tar', function() {
    return del([ '/tmp/asyncp.tar.gz' ], { force: true });
});

gulp.task('tar:dist', ['clean:tar'], function(done) {
    let tar = spawn(
        'tar',
        [
            '--exclude=".DS_*"',
            '-czvf', '/tmp/asyncp.tar.gz',
            '-C', './', 'package.json',
            '-C', './dist', '.'
        ],
        {
            stdio: 'inherit',
            env: {
                COPYFILE_DISABLE: 1
            }
        }
    );

    tar.on('close', function(code) {
        if (code != 0) {
            return done(new Error(`Received code ${code} from tar command.`));
        }

        done();
    });
});

gulp.task('npm:publish', ['tar:dist'], function(done) {
    return done();

    let npm = spawn(
        'npm',
        [
            'publish',
            '/tmp/asyncp.tar.gz'
        ],
        {<commit_msg>Add README.md to publish tar<commit_after>const gulp = require('gulp');
const babel = require('gulp-babel');
const del = require('del');
const bump = require('gulp-bump');
const spawn = require('child_process').spawn;
const git = require('gulp-git');

['major', 'minor', 'patch'].forEach(function(version) {
    gulp.task(`bump:${version}`, function() {
        gulp.src('./package.json')
            .pipe(bump({ type: version }))
            .pipe(gulp.dest('./'));
    });

    gulp.task(`release:${version}`, [`bump:${version}`, 'tag:release', 'npm:publish']);
});

gulp.task('bump', ['bump:patch']);
gulp.task('release', ['build:dist', 'bump:patch', 'tag:release', 'npm:publish']);

gulp.task('tag:release', function(done) {
    var pkg = require('./package.json');
    var message = `Release ${pkg.version}`;

    return gulp.src('./')
        .pipe(git.add({ args: '-u' }))
        .pipe(git.commit(message))
        .pipe(git.tag(pkg.version, message))
        .pipe(git.push('origin', 'master', { args: '--tags' }))
        .pipe(gulp.dest('./'));
});

gulp.task('clean:tar', function() {
    return del([ '/tmp/asyncp.tar.gz' ], { force: true });
});

gulp.task('tar:dist', ['clean:tar'], function(done) {
    let tar = spawn(
        'tar',
        [
            '--exclude=".DS_*"',
            '-czvf', '/tmp/asyncp.tar.gz',
            './package.json',
            './README.md',
            '-C', './dist', '.'
        ],
        {
            stdio: 'inherit',
            env: {
                COPYFILE_DISABLE: 1
            }
        }
    );

    tar.on('close', function(code) {
        if (code != 0) {
            return done(new Error(`Received code ${code} from tar command.`));
        }

        done();
    });
});

gulp.task('npm:publish', ['tar:dist'], function(done) {
    let npm = spawn(
        'npm',
        [
            'publish',
            '/tmp/asyncp.tar.gz'
        ],
        {
{'fraction_non_alphanumeric': 0.22653806047966632, 'fraction_numerical': 0.0010427528675703858, 'mean_word_length': 2.1975, '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': '4684577', 'n_tokens_mistral': 1291, 'n_tokens_neox': 1259, 'n_words': 226}