File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33function fetch_pear() {
44 set +o errexit
55 local tries max_tries
6+ version=$1
67
78 tries=1
89 max_tries=10
@@ -14,15 +15,16 @@ function fetch_pear() {
1415
1516 while [[ $tries -le $max_tries ]]; do
1617 echo " Try $tries of $max_tries "
17- latest_tag=$( curl -sSfL --retry 20 " ${auth_flag} " https://api.github.com/repos/pear/pearweb_phars/releases/latest | jq -r .tag_name)
18- if [ -n $latest_tag ]; then
19- curl -sSfL " ${auth_flag} " --retry 20 -O https://raw.githubusercontent.com/pear/pearweb_phars/${latest_tag} /go-pear.phar
18+ if [ -z $version ]; then
19+ version=$( curl -sSfL --retry 20 " ${auth_flag} " https://api.github.com/repos/pear/pearweb_phars/releases/latest | jq -r .tag_name)
2020 fi
2121
22+ curl -sSfL " ${auth_flag} " --retry 20 -O https://raw.githubusercontent.com/pear/pearweb_phars/${version} /go-pear.phar
23+
2224 if [ -f go-pear.phar ]; then
2325 break
2426 fi
25-
27+
2628 let tries=$tries +1
2729 echo " Failed to fetch the latest go-pear.phar. Sleeping for ${sleep_interval} seconds."
2830 sleep $sleep_interval
@@ -64,7 +66,7 @@ sudo wget -O /usr/local/ssl/cert.pem https://curl.haxx.se/ca/cacert.pem
6466# this could be a temp issue though
6567if [[ ! $VERSION =~ ^master$ || $VERSION =~ snapshot$ ]]; then
6668 # pear
67- fetch_pear
69+ fetch_pear ' v1.10.12 '
6870
6971 env TZ=UTC $TRAVIS_BUILD_DIR /bin/install-pear
7072 rm go-pear.phar
You can’t perform that action at this time.
0 commit comments