File size: 578 Bytes
eb846d0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#!/bin/bash
NPM_REGISTRY=${NPM_REGISTRY:-https://registry.npmjs.org/}
echo "Setting npm registry to ${NPM_REGISTRY}"
npm config set registry "$NPM_REGISTRY"
# 处理 HTTP_PROXY 和 HTTPS_PROXY 环境变量
if [ -n "$HTTP_PROXY" ]; then
echo "Setting HTTP proxy to ${HTTP_PROXY}"
npm config set proxy "$HTTP_PROXY"
export HTTP_PROXY="$HTTP_PROXY"
fi
if [ -n "$HTTPS_PROXY" ]; then
echo "Setting HTTPS proxy to ${HTTPS_PROXY}"
npm config set https-proxy "$HTTPS_PROXY"
export HTTPS_PROXY="$HTTPS_PROXY"
fi
echo "Using REQUEST_TIMEOUT: $REQUEST_TIMEOUT"
exec "$@"
|