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 3
3
function fetch_pear() {
4
4
set +o errexit
5
5
local tries max_tries
6
+ version=$1
6
7
7
8
tries=1
8
9
max_tries=10
@@ -14,15 +15,16 @@ function fetch_pear() {
14
15
15
16
while [[ $tries -le $max_tries ]]; do
16
17
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)
20
20
fi
21
21
22
+ curl -sSfL " ${auth_flag} " --retry 20 -O https://raw.githubusercontent.com/pear/pearweb_phars/${version} /go-pear.phar
23
+
22
24
if [ -f go-pear.phar ]; then
23
25
break
24
26
fi
25
-
27
+
26
28
let tries=$tries +1
27
29
echo " Failed to fetch the latest go-pear.phar. Sleeping for ${sleep_interval} seconds."
28
30
sleep $sleep_interval
@@ -64,7 +66,7 @@ sudo wget -O /usr/local/ssl/cert.pem https://curl.haxx.se/ca/cacert.pem
64
66
# this could be a temp issue though
65
67
if [[ ! $VERSION =~ ^master$ || $VERSION =~ snapshot$ ]]; then
66
68
# pear
67
- fetch_pear
69
+ fetch_pear ' v1.10.12 '
68
70
69
71
env TZ=UTC $TRAVIS_BUILD_DIR /bin/install-pear
70
72
rm go-pear.phar
You can’t perform that action at this time.
0 commit comments