<commit_before>var NwBuilder = require('node-webkit-builder');
var gulp = require('gulp');
var gutil = require('gulp-util');

gulp.task('nw', function (callback) {

    var nw = new NwBuilder({
        version: '0.9.2',
        files: [ './nwapp/**']
    });

    // Log stuff you want
    nw.on('log', function (mgs) {
        gutil.log('node-webkit-builder', mgs);
    });

    // Build retruns a promise
    nw.build(function (err) {
        if(err) {
            gutil.log('node-webkit-builder', err);
        }
        callback();
        gutil.beep();
    });
});<commit_msg>Use promises in Gulp example<commit_after>var NwBuilder = require('node-webkit-builder');
var gulp = require('gulp');
var gutil = require('gulp-util');

gulp.task('nw', function () {

    var nw = new NwBuilder({
        version: '0.9.2',
        files: [ './nwapp/**']
    });

    // Log stuff you want
    nw.on('log', function (msg) {
        gutil.log('node-webkit-builder', msg);
    });

    // Build returns a promise, return it so the task isn't called in parallel
    return nw.build().catch(function (err) {
        gutil.log('node-webkit-builder', err);
    });
});

{'fraction_non_alphanumeric': 0.182916307161346, 'fraction_numerical': 0.005176876617773943, 'mean_word_length': 2.4421364985163203, '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': '2805105', 'n_tokens_mistral': 401, 'n_tokens_neox': 381, 'n_words': 90}