summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-09 20:20:24 +0800
committerruki <[email protected]>2020-02-09 20:20:24 +0800
commitbd840ed2e992a87a4fef9f974a3474033add3652 (patch)
tree27f03a5ede785294e9e54a0522d93ac35efd0443 /scripts
parent8724d1ac621e6cacde58e8747e849e1649ef7a17 (diff)
improve get.sh using jsdeliver
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/get.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/get.sh b/scripts/get.sh
index 75171a24e..53ef2c33d 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -82,15 +82,13 @@ if [ 'x__local__' != "x$branch" ]; then
if [ "$fasthost" == "gitee.com" ]; then
gitrepo="https://gitee.com/tboox/xmake.git"
gitrepo_raw="https://gitee.com/tboox/xmake/raw/master"
- if [ 'x__run__' = "x$branch" ]; then
- branch=$(git ls-remote --tags "$gitrepo" | tail -c 7)
- fi
elif [ "$fasthost" == "gitlab.com" ]; then
gitrepo="https://gitlab.com/tboox/xmake.git"
gitrepo_raw="https://gitlab.com/tboox/xmake/-/raw/master"
else
gitrepo="https://github.com/xmake-io/xmake.git"
- gitrepo_raw="https://github.com/xmake-io/xmake/raw/master"
+ #gitrepo_raw="https://github.com/xmake-io/xmake/raw/master"
+ gitrepo_raw="https://cdn.jsdelivr.net/gh/xmake-io/xmake"
fi
fi
@@ -176,9 +174,14 @@ elif [ 'x__run__' = "x$branch" ]; then
pack=gz
fi
mkdir -p $projectdir
- runfile_url="https://github.com/xmake-io/xmake/releases/download/$version/xmake-$version.$pack.run"
+ runfile_url="https://cdn.jsdelivr.net/gh/xmake-mirror/xmake-releases/xmake-$version.$pack.run"
echo "downloading $runfile_url .."
remote_get_content "$runfile_url" > $projectdir/xmake.run
+ if [[ $? != 0 ]]; then
+ runfile_url="https://github.com/xmake-io/xmake/releases/download/$version/xmake-$version.$pack.run"
+ echo "downloading $runfile_url .."
+ remote_get_content "$runfile_url" > $projectdir/xmake.run
+ fi
sh $projectdir/xmake.run --noexec --target $projectdir
else
if [ x != "x$2" ]; then