-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win/Linux release will not resolve when task finishes #25
Comments
It should be resolved here: https://github.com/mllrsohn/grunt-node-webkit-builder/blob/master/tasks/lib/compress.js#L68-L70 but I'll take a look at it |
I played around with your code, inside compress.js: ws.on('close', function() {
grunt.log.writeln('ws.close event fired');
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.on('end', function() {
grunt.log.writeln('Resolving/finishing');
releaseDone.resolve(type);
});
grunt.log.writeln(zipPath);
zipStream.pipe(ws);
});
nwpath_rs.pipe(ws, { end: false });
} Guess what, the console tells me:
But it never tells me Do you have any idea? |
Which plattform are you on? Because the concat of the files for win/linux and execution of tasks (before and after) works fine of mac. Here are some more console logs to show the current control flow: exports.generateRelease = function(relaseFile, zipPath, type, nwpath) {
var releaseDone = Q.defer(),
ws = fs.createWriteStream(relaseFile),
zipStream = fs.createReadStream(zipPath),
nwpath_rs;
ws.on('error', function(err) {
grunt.fail.fatal(err);
});
ws.on('close', function() {
console.log('4. Writing to the releaseFile Endes -> promise resolved');
releaseDone.resolve(type);
});
zipStream.on('close', function() {
console.log('3. Reading from the zipStream ends');
});
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(){
console.log('2. Reading the .exe/nw file ends, now we pipe in the zip we created');
zipStream.pipe(ws);
});
console.log('1. Piping the .exe at nwpath_rs into a new file and not close the stream');
nwpath_rs.pipe(ws, { end: false });
}
return releaseDone.promise;
}; |
I'm on a mac (10.8.5) and I get this (for Mac+Win configuration) Running "nodewebkit:src" (nodewebkit) task
1. (win) Piping the .exe at nwpath_rs into a new file and not close the stream
3. (win) Reading from the zipStream ends
3. (mac) Reading from the zipStream ends
4. (mac) Writing to the releaseFile Endes -> promise resolved
2. (win) Reading the .exe/nw file ends, now we pipe in the zip we created As you notice, there is no Running "clean:releases" (clean) task
Cleaning "./build/releases/"...OK
Done, without errors. There is something going wrong, because my win file is not concatenated. |
There is definitely something wrong, this is my output. Are you running any other task or just node webkit?
|
I'm running it either way. Standalone, and with some other grunt tasks (like clean, right before). What version of node are you using? |
Version seems to solve the problem. Tried it with Running "nodewebkit:src" (nodewebkit) task
1. (win) Piping the .exe at nwpath_rs into a new file and not close the stream
3. (mac) Reading from the zipStream ends
4. (mac) Writing to the releaseFile Endes -> promise resolved
2. (win) Reading the .exe/nw file ends, now we pipe in the zip we created
3. (win) Reading from the zipStream ends
4. (win) Writing to the releaseFile Endes -> promise resolved
>> Created a new release with node-webkit (0.7.5) for win, mac
...
Done, without errors. Maybe set a minimum node.js version as dependency :-) |
Yeah there were some bugs in earlier versions :) if everything works as expected, please close the issue. |
You should set a proper node version as dependency, before the bug is closed. A proper version dependency would help others to not run into the same problem by accident. Does this make sense to you? (Btw, here's an open bug for the |
Hmm ok I though you meant the version of the plugin and not node - hmm this is basic streaming stuff and should work almost everywhere. Thanks for the report I'll try to test it on 0.8.x and keep the bug open |
Actually I meant the version of node, because - at least on my mac - it does not work with |
10times 👍 |
... and this causes to not execute any other grunt task in line
Please add
in compress.js after line 87
Thanks in advance!
Or it maybe relates to another bug, since the zip file and the executable seem not to be concatenated (at least for win).
P.S.: Thanks for creating this nice little grunt task!
The text was updated successfully, but these errors were encountered: