-
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
Add --cafile command line option. #837
Conversation
@@ -444,3 +407,60 @@ function install (gyp, argv, callback) { | |||
} | |||
|
|||
} | |||
|
|||
function download (gyp, env, url, 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.
taking a cb option that's only used when erroring is a bit gross, perhaps it'd closer to idiomatic if the thrown error bubbled up and the try/catch was done at the download()
call?
A bit smelly, I understand that it's hard to do much better without a more heavy refactor. Things I don't like:
A begrudging lgtm since I understand the challenges of doing a better job, I would prefer the Yet another refactor for the future I suppose. |
I added a commit that lets the exception bubble up. I'm a bit on the fence on whether it's an improvement; let me know what you think. |
I'm happy with the clarity of the changes, but generally unhappy with the structure of the call chain but that's a matter for another day! lgtm |
Move the function around so it can be tested and add a regression test. As a policy vs. mechanism thing, change the control flow to handle exceptions at the call site, not inside the download function. PR-URL: #837 Reviewed-By: Rod Vagg <[email protected]>
Add an option for overriding the default CA chain that is used when downloading the tarball. This matches the npm option of the same name and gets implicitly passed through the `npm_config_cafile` environment variable. Fixes: #695 PR-URL: #837 Reviewed-By: Rod Vagg <[email protected]>
…o "undefined" cafile Refs: nodejs/node-gyp#837, nodejs/node-gyp#844 Failed job: https://ci.appveyor.com/project/brianreavis/node-gdal/build/job/n9u9mr7a sfrlbs55
…o "undefined" cafile Refs: nodejs/node-gyp#837, nodejs/node-gyp#844 Failed job: https://ci.appveyor.com/project/brianreavis/node-gdal/build/job/n9u9mr7a sfrlbs55
R=@rvagg?