-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
install: de-duplicate code in downloadNodeLib() function #965
Conversation
Modified the result of processRelease() to return uniform names `libUrl`, `libPath` for Windows in objects named as target platforms (`ia32` and `x64`) This allows to loop over the target platforms in downloadNodeLib() and to use the universal names instead of two almost identical code parts with `libUrl32`, `libPath32` and `libUrl64`, `libPath64` names.
done(new Error(res.statusCode + ' status code downloading 32-bit ' + release.name + '.lib')) | ||
return | ||
var archs = ['ia32', 'x64'] | ||
var async = archs.length |
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.
best avoid the async
keyword for future-proofing
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.
There are many variables named async
in the code above, I just used the same name.
I don't mind this refactor although I consider the changes in process-release to be breaking because that module is usable outside of node-gyp (I've used it myself that way). The change is good, but I'd rather hold this off till v4, which we're close to because of the |
As I see |
but anyway, we can break stuff in v4 so whatever |
sorry this got stale @pmed, still want to pursue it? if so, rebase to current master and let's take a look |
Hi @rvagg I've rebased it on the master. |
Modified the result of processRelease() to return uniform names `libUrl`, `libPath` for Windows in objects named as target platforms (`ia32` and `x64`) This allows to loop over the target platforms in downloadNodeLib() and to use the universal names instead of two almost identical code parts with `libUrl32`, `libPath32` and `libUrl64`, `libPath64` names. PR-URL: #965 Reviewed-By: Rod Vagg <[email protected]>
Modified the result of processRelease() to return uniform names
libUrl
,libPath
for Windows in objects named as target platforms (ia32
andx64
)This allows to loop over the target platforms in downloadNodeLib() and to use
the universal names instead of two almost identical code parts with
libUrl32
,libPath32
andlibUrl64
,libPath64
names.