From 16ef0373d7e72f698fb6e232b78e5c78a0587044 Mon Sep 17 00:00:00 2001 From: TheInterestingSoul Date: Wed, 7 Oct 2020 14:21:36 +0800 Subject: [PATCH] Add jsDelivr CDN source and "--noconfirm" option --- archdi | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/archdi b/archdi index 7962631..7d79726 100755 --- a/archdi +++ b/archdi @@ -18,15 +18,19 @@ cachedir=~/.cache/archdi lastverurl1=http://archdi.sourceforge.net/version lastverurl2=https://raw.githubusercontent.com/MatMoul/archdi/master/version +lastverurl3=https://cdn.jsdelivr.net/gh/MatMoul/archdi@master/version binurl1=archdi.sourceforge.net/archdi binurl2=matmoul.github.io/archdi +binurl3=https://cdn.jsdelivr.net/gh/MatMoul/archdi@master/archdi liburl1=http://archdi.sourceforge.net/archdi-lib liburl2=https://raw.githubusercontent.com/MatMoul/archdi-pkg/master/lib +liburl3=https://cdn.jsdelivr.net/gh/MatMoul/archdi-pkg@master/lib pkgurl1=http://archdi.sourceforge.net/archdi-pkg pkgurl2=https://raw.githubusercontent.com/MatMoul/archdi-pkg/master/pkg.tar +pkgurl3=https://cdn.jsdelivr.net/gh/MatMoul/archdi-pkg@master/pkg.tar help(){ @@ -121,7 +125,15 @@ dependencies(){ liburl=$liburl2 pkgurl=$pkgurl2 else - exit 1 + lastverurl=$lastverurl3 + lastver=$(curl $lastverurl) + if [ "$?" = "0" ] && [ "${#lastver}" = "19" ]; then + binurl=$binurl3 + liburl=$liburl3 + pkgurl=$pkgurl3 + else + exit 1 + fi fi fi echo "" @@ -146,7 +158,7 @@ dependencies(){ case "$choice" in n|N ) exit 1;; esac - pacman -S --needed wget libnewt + pacman -S --needed --noconfirm wget libnewt fi echo "" echo "Checking bin version..."