summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorweearc2019-06-02 23:36:54 +0800
committerweearc2019-06-02 23:36:54 +0800
commit01633fa2f4da65e7e1f0da70ac483f8b667cef02 (patch)
tree89483f88116eaf0fc71f25807ecf1c1d9b53dccd /PKGBUILD
parent41350c7a108dd7949202286a5134c7eb84fc06b3 (diff)
downloadaur-01633fa2f4da65e7e1f0da70ac483f8b667cef02.tar.gz
add IP testing and mirror changing
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD27
1 files changed, 23 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 7cafbd9af9ca..9bc3f70620d3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@ pkgname=motrix
_pkgname=Motrix
pkgver=v1.3.8
_pkgver=1.3.8
-pkgrel=2
+pkgrel=3
epoch=
pkgdesc="elegent downloading tool frontend for aria2c,using vue(release version)"
arch=("x86_64")
@@ -50,9 +50,28 @@ prepare() {
tar -xvf $_pkgname.tar.gz
rm $_pkgname.tar.gz
mv $_pkgname-$_pkgver $_pkgname
-# npm config set registry 'https://registry.npm.taobao.org'
- export ELECTRON_MIRROR='https://npm.taobao.org/mirrors/electron/'
- export SASS_BINARY_SITE='https://npm.taobao.org/mirrors/node-sass'
+ echo "====================================="
+ echo "Finding if you are in China..."
+ curl myip.ipip.net | grep -i "中国"
+ if [ $? -eq 0 ]
+ then
+ echo "Yes,I'm sure you are in China."
+ echo "To speed up installation I'll change npm mirrors to Taobao."
+ npm config set registry 'https://registry.npm.taobao.org'
+ export ELECTRON_MIRROR='https://npm.taobao.org/mirrors/electron/'
+ export SASS_BINARY_SITE='https://npm.taobao.org/mirrors/node-sass'
+ else
+ curl myip.ipip.net | grep -i "China"
+ if [ $? -eq 0 ]
+ then
+ echo "Yes,I'm sure you are in China."
+ echo "To speed up installation I'll change npm mirrors to Taobao."
+ npm config set registry 'https://registry.npm.taobao.org'
+ export ELECTRON_MIRROR='https://npm.taobao.org/mirrors/electron/'
+ export SASS_BINARY_SITE='https://npm.taobao.org/mirrors/node-sass'
+ fi
+ fi
+ echo "======================================"
sed -i '/"dmg"/,/"linux"/{//!d}' $_pkgname/package.json
sed -i '/"dmg"/d' $_pkgname/package.json
sed -i '/"deb"/d' $_pkgname/package.json