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();
    });
});
@@ -130,24 +130,16 @@
 nction (
-callback
 ) %7B%0A%0A   
@@ -284,18 +284,18 @@
 ction (m
-g
 s
+g
 ) %7B%0A    
@@ -336,10 +336,10 @@
 ', m
-g
 s
+g
 );%0A 
@@ -366,10 +366,10 @@
  ret
-r
 u
+r
 ns a
@@ -380,21 +380,84 @@
 mise
-%0A    nw.build
+, return it so the task isn't called in parallel%0A    return nw.build().catch
 (fun
@@ -474,30 +474,8 @@
 ) %7B%0A
-        if(err) %7B%0A    
     
@@ -521,60 +521,8 @@
 r);%0A
-        %7D%0A        callback();%0A        gutil.beep();%0A
     
@@ -528,8 +528,9 @@
  %7D);%0A%7D);
+%0A

Use promises in Gulp example