mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
support npm proxy configuration for the installation script (#692)
This patch starts supporting NPM proxy configuration in the installation script. If both NPM proxy and environment proxy are set, NPM proxy settings are preferred. Fixes #648
This commit is contained in:
parent
8d2a427eee
commit
b8bb80a089
@ -29,6 +29,14 @@ const revisionInfo = Downloader.revisionInfo(platform, revision);
|
||||
if (revisionInfo.downloaded)
|
||||
return;
|
||||
|
||||
// Override current environment proxy settings with npm configuration, if any.
|
||||
const NPM_HTTPS_PROXY = process.env.npm_config_https_proxy || process.env.npm_config_proxy;
|
||||
const NPM_HTTP_PROXY = process.env.npm_config_http_proxy || process.env.npm_config_proxy;
|
||||
if (NPM_HTTPS_PROXY)
|
||||
process.env.HTTPS_PROXY = NPM_HTTPS_PROXY;
|
||||
if (NPM_HTTP_PROXY)
|
||||
process.env.HTTP_PROXY = NPM_HTTP_PROXY;
|
||||
|
||||
const allRevisions = Downloader.downloadedRevisions();
|
||||
Downloader.downloadRevision(platform, revision, onProgress)
|
||||
.then(onSuccess)
|
||||
|
Loading…
Reference in New Issue
Block a user