-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
use fs-extra copy instead of ncp #318
Conversation
@@ -220,7 +220,7 @@ Object (also known as a "hash") of application metadata to embed into the execut | |||
|
|||
### `err` | |||
|
|||
*Error* (or *Array*, in the case of an `ncp` error) | |||
*Error* (or *Array*, in the case of an `copy` error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does copy
actually create an Array
on erroring? Because that would be very unfortunate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I answered my own question below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can pass stopOnError: true
to stop on first error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably update all of the copy
calls to use that (in a separate PR). Having err
be potentially more than one type is problematic for users.
@develar I looked into how |
@@ -4,6 +4,8 @@ | |||
"dependencies": { | |||
"run-series": "^1.1.1" | |||
}, | |||
"//": "ncp used to test https://github.com/electron-userland/electron-packager/pull/186", | |||
"///": "(a module (with zero dependencies) that creates a file in node_modules/.bin)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a really unfortunate way to annotate JSON files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but npm doesn't support other ways (e.g. typescript supports comments in the tsconfig.json) :(
By the way, it might be better to squash your commits when the PR has been approved. It makes it easier for reviewers to see what changed, especially now that GitHub has added features to the pull request UI. |
There is a comment AvianFlu/ncp#98 (comment) so, I think, it is definitely fixed in the fs-extra. I don't see any particular file sets in the #150 and #213 so, I am not sure how I can test it. May be we can trust @jprichardson and existing fs-extra tests? |
Ok, I will not amend commits anymore. |
I'm not so sure the ncp issue you mention is fixed in fs-extra. If it is, it wasn't obvious from the commit log. My reading of his comment was more along the lines of "here's a maintained version of ncp". |
To my knowledge, I've fixed most of the outstanding issues in my forked copy of |
@jprichardson the issue I'm unsure that it fixes is AvianFlu/ncp#98. Another look through the history (GitHub does not make that easy due to the multiple renames) indicates that it may be the same as jprichardson/node-fs-extra#98 (coincidentally enough)? |
AvianFlu/ncp#98 leaves out a lot of details, so it's unclear of the problem. The commenter just states that the callback is never being called with no code to reproduce. Who knows why. I put a ton of work into fixing the issues in Also, I can state that I use |
@jprichardson @develar OK, sounds good to me. At minimum, it gets rid of an extra dependency (I've already gotten rid of direct production dependencies on @develar once you rebase, LGTM. |
Closes #213, #150, #151
@develar FYI your build failed, seems you missed some |
Oh, I wanted to add one additional point. If it matters, |
It's been a while since we've supported 0.10 officially. I think I had to remove support for it in Travis CI for some feature, and to my knowledge there have been no complaints. At any rate, I filed a PR the other day that definitely removes support for Node < 4.0. So we're OK 😄 |
Closes #213, #150, #151
Sorry, fixed. |
Just wanted to point out this doesnt close #151, that issue is about using tar-fs, which IMO is a lot more dependable performance wise than fs-extra/ncp. |
Removed #151 from the issue summary. |
Would love to know why so that I can improve Overall though, |
It is a bit illogical for me. How does tar work — read file and append content to resulting (total) file. And then we will read total file and split it to destination files. So, why it will be faster? copy operation just transfer bytes from one file to another. Or do you mean that copy is not reliable? Well... if nobody can write reliable copy implementation on node platform... But I don't think so — I have tried 3 different implementations and only fs-extra copy works for me (electron-builder tests — copying test fixtures). And recently windows-installer got rid of jetpack and switched to fs-extra. So, #151 was mentioned not by mistake. |
Apart of this, I am going to get rid of copy phase (copy app files) at all :) Because if |
That "squash and merge" feature in GitHub's UI is pretty great. Won't work all the time, but worked well in this instance. |
Closes #213, #150
electron-builder tests passed as well.