mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 07:26:26 +00:00
4f59b62da4
* chore(deps): update dependency prettier to v2 * Run prettier-fix Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Jamie Magee <jamie.magee@gmail.com>
21 lines
593 B
TypeScript
21 lines
593 B
TypeScript
import {
|
|
createGlobalProxyAgent,
|
|
ProxyAgentConfigurationType,
|
|
} from 'global-agent';
|
|
|
|
const envVars = ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY'];
|
|
|
|
export function bootstrap(): ProxyAgentConfigurationType {
|
|
envVars.forEach((envVar) => {
|
|
/* istanbul ignore if: env is case-insensitive on windows */
|
|
if (
|
|
typeof process.env[envVar] === 'undefined' &&
|
|
typeof process.env[envVar.toLowerCase()] !== 'undefined'
|
|
) {
|
|
process.env[envVar] = process.env[envVar.toLowerCase()];
|
|
}
|
|
});
|
|
return createGlobalProxyAgent({
|
|
environmentVariableNamespace: '',
|
|
});
|
|
}
|