mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
21 lines
497 B
JavaScript
21 lines
497 B
JavaScript
const { createGlobalProxyAgent } = require('global-agent');
|
|
|
|
module.exports = {
|
|
bootstrap,
|
|
};
|
|
|
|
const envVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];
|
|
|
|
function bootstrap() {
|
|
envVars.forEach(envVar => {
|
|
if (
|
|
typeof process.env[envVar] === 'undefined' &&
|
|
typeof process.env[envVar.toLowerCase()] !== 'undefined'
|
|
) {
|
|
process.env[envVar] = process.env[envVar.toLowerCase()];
|
|
}
|
|
});
|
|
return createGlobalProxyAgent({
|
|
environmentVariableNamespace: '',
|
|
});
|
|
}
|