exports.generateRelease = function(relaseFile, zipPath, type, nwpath) {
        var releaseDone = Q.defer(),
            ws = new Writable(function() {
                return fs.createWriteStream(relaseFile);
            }),
            zipStream = new Readable(function() {
                return fs.createReadStream(zipPath);
            }),
            nwpath_rs;

        ws.on('error', function(err) {
            grunt.fail.fatal(err);
        });

        ws.on('finish', function() {
            if(type.indexOf('linux') !== -1) {
                fs.chmodSync(relaseFile, '0755');
            }
            releaseDone.resolve(type);
        });

        if(type === 'mac') {
            // On osx just copy to the target location
            zipStream.pipe(ws);
        } else {
            // on windows and linux cat the node-webkit with the nw archive
            nwpath_rs = fs.createReadStream(nwpath);

            nwpath_rs.on('error', function(err) {
                grunt.fail.fatal(err);
            });

            nwpath_rs.on('end', function(){
                zipStream.pipe(ws);
            });

            nwpath_rs.pipe(ws, { end: false });
        }

        return releaseDone.promise;
    };
 nwpath_rs.on('end', function(){
     zipStream.pipe(ws);
 });