-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implemented an 'afterExtract' function hook RE: #270 #354
Conversation
}) | ||
series(newFunctions, cb) | ||
} | ||
}) |
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 the callback you defined for extract
should be another function in the series.
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.
Are you suggesting then that we should do
series([extract(zipPath, {dir: buildDir})].concat(newFunctions))
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 was thinking more along the lines of
function (cb) {
extract(zipPath, {dir: buildDir}, cb)
},
function (cb) {
if (opts.afterExtract exists and is not array) {
return error
}
// etc.
}
...that got pseudocode-y, fast.
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.
Ah got it 👍
Done
|
||
* `buildPath` - The path to the temporary folder where Electron has been extracted to | ||
* `electronVersion` - The version of electron you are packaging for | ||
* `callback` - Must be called once you have completed your actions |
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.
Minor nit: the rest of the file has standardized on -
for list items.
8a251b2
to
f0940c8
Compare
Looks good, I think this just needs at least one unit test. |
@malept Not too familiar with the testing framework here but I added some tests 👍 |
The test logic looks OK at a glance (I'll look at it in more detail tomorrow), but I'd prefer if it had its own test instead of tacking it onto another test. |
@malept I've moved the logic to it's own test and moved it to a new file called "hooks" so that if in the future we add more of these hooks we have a place for them to go 👍 |
Sorry about the delay, work & real life got in the way. I had merged #351 before this one, so if you could take care of the |
@malept Talk about delay 😆 I finally got around to adding |
Amusingly enough, this morning I did something similar. The only difference is that the require statements are |
@malept So who's do we use 😆 |
I added a PR for my branch (#403). I'll wait for CI to run and then merge it. |
Add afterExtract hook Closes #354.
This PR adds an
afterExtract
option to the API. This option should be an array of functions, each of which is called directly afterelectron-packager
has finished extracting to the temporary directory.Relevant issue: #270