-
-
Notifications
You must be signed in to change notification settings - Fork 29
Automatically ignore --out path #255
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
Conversation
a4f7f75 to
2f3b4a0
Compare
|
I would prefer that since you're building on #155, that you rebase + squash that branch so that the original author is still attributed to their changes, and then an additional commit is for you adding the tests and docs requested. |
861f1bd to
274cfaf
Compare
|
Sorry for noise, I created pull request too early (realized, that my test is not correct). I will add comment when it will be ready. Yeah, writing tests is not easy. |
274cfaf to
55e7bb3
Compare
|
Strange. Tests passed locally, but not on Travis. And in your build (https://travis-ci.org/maxogden/electron-packager/jobs/107157456) I see the same error. I will start build again in a few hours. |
Fixed, I set author to |
2249101 to
23e41ff
Compare
|
I don't see what's wrong in my code. And Travis build passed. (I see that another unrelated build also blinking). Maybe, it will be better to test such functionality only for current platform (not for all platforms) to speedup tests, but I used standard |
|
Could you add one more test for the new ignore functionality when you don't specify an |
It is required to fix #64 I don't like it, but as a tool we cannot teach users, ok. Current solution is not complete, thanks for pointing. |
2fe28c3 to
ba65340
Compare
common.js
Outdated
| var outIgnores = [] | ||
| if (normalizedOut === null || normalizedOut === process.cwd()) { | ||
| ['darwin', 'linux', 'win32'].forEach(function (platform) { | ||
| ['ia32', 'x64'].forEach(function (arch) { |
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.
|
Tests failed due to critical error in all tests —
As part of this pull request I will fix it (we must pass copied |
Sorry, tried to minimise, but it is stupid, yes. Fixed. |
index.js
Outdated
| var supportedPlatforms = common.platforms.reduce(function (o, v) { | ||
| o[v] = './' + (v === 'darwin' ? 'mac' : v) | ||
| return o | ||
| }, {}) |
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.
In my opinion, this makes it a bit more difficult to understand what's going on.
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 also prefer to use for of instead of magic function style. But I see forEach in existing code.
Do you want to convert it to
var supportedPlatforms = {}
for (var platform in common.platforms) {
supportedPlatforms[platform] = './' + (platform === 'darwin' ? 'mac' : platform)
}?
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.
At the very least, please don't use single-letter variables here. Please also keep in mind that there is a PR to add the Mac App Store (MAS) platform (#223) which currently also uses the mac.js file.
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.
Variables renamed. I don't want to pollute file scope, but cannot use let, so, still use reduce instead of for in (for of es6).
Mac App Store (MAS) platform can be added as before — directly to supportedPlatforms (or inside reduce function — in any case we check is equal to darwin?).
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 think with your current code, the MAS change will look like this:
result[platform] = './' + (['darwin', 'mas'].indexOf(platform) !== -1 ? 'mac' : platform)It's not great.
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.
Or
var supportedPlatforms = common.platforms.reduce(function (result, platform) {
result[platform] = './' + (platform === 'darwin' ? 'mac' : platform)
return result
}, {
mas: './mac'
})
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.
Seems like you may as well do either option for darwin as well and get rid of the ternary operator. (Though I'm not convinced that the second option actually works.)
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.
It seems, you don't like ternary operator :)
Ok, my code saves only 2 lines (linux and windows). Maybe we can rename mac.js to darwin.js to consolidate, but I don't think that it is an acceptable solution.
So, I reverted this block to previous.
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'm OK with ternary operators when all parts of the statement are simple.
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.
Travis build passed, please review.
5a9cf3b to
1b1d8d2
Compare
|
Should I fix something or you just haven't yet time to review it? |
|
Sorry, I've been holding off reviewing/merging other PRs because #223 is bigger than the others. Hopefully in the next couple of days. |
|
Yep, I figured that you would need to rebase after I merged the PR I mentioned earlier. |
1b1d8d2 to
31487c8
Compare
|
@malept I missed your quick reply, sorry. I have rebased. |
…g directory and we exclude previous artifacts directories)
…ect — version property was deleted from prototype
31487c8 to
6623c25
Compare
Automatically ignore --out path Closes #155.
This pull request supersedes #155. And is required for #251.
Tests and doc added.