diff options
-rw-r--r-- | PKGBUILD | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -62,15 +62,14 @@ build() { export ELECTRONVERSION="${_electronversion}" export npm_config_disturl=https://electronjs.org/headers HOME="${srcdir}/.electron-gyp" - #build - cd "${srcdir}/${pkgname//-/.}" - if [ `curl ifconfig.co/country` = "China" ];then - echo 'registry="https://registry.npmmirror.com/"' >> .npmrc - echo 'electron_mirror="https://registry.npmmirror.com/-/binary/electron/"' >> .npmrc - echo 'electron_builder_binaries_mirror="https://registry.npmmirror.com/-/binary/electron-builder-binaries/"' >> .npmrc + if [ `curl -s ipinfo.io/country | grep CN | wc -l ` -ge 1 ];then + export npm_config_registry=https://registry.npmmirror.com + export npm_config_electron_mirror=https://registry.npmmirror.com/-/binary/electron/ + export npm_config_electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/ else echo "Your network is OK." fi + cd "${srcdir}/${pkgname//-/.}" # Install packages npm ci --ignore-scripts --prefer-offline --no-audit npm run bootstrap -- --scope=web |