summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorweearc2019-06-02 23:36:54 +0800
committerweearc2019-06-02 23:36:54 +0800
commit01633fa2f4da65e7e1f0da70ac483f8b667cef02 (patch)
tree89483f88116eaf0fc71f25807ecf1c1d9b53dccd
parent41350c7a108dd7949202286a5134c7eb84fc06b3 (diff)
downloadaur-motrix.tar.gz
add IP testing and mirror changing
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD27
2 files changed, 24 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index af58fe62bd3..60d93671e94 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = motrix
pkgdesc = elegent downloading tool frontend for aria2c,using vue(release version)
pkgver = v1.3.8
- pkgrel = 2
+ pkgrel = 3
url = https://github.com/agalwood/Motrix
arch = x86_64
license = MIT
diff --git a/PKGBUILD b/PKGBUILD
index 7cafbd9af9c..9bc3f70620d 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