Skip to content

Commit c2b1172

Browse files
committed
Make get_current_sdk_version more resilient
1 parent d6ddd7b commit c2b1172

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#!/bin/sh
22

3-
if [ -f /usr/bin/curl ]
3+
LAST_KNOWN_GOOD_VERSION="1.9.40"
4+
5+
if [ -f $(which curl) ]
46
then
5-
curl -s https://storage.googleapis.com/appengine-sdks/featured/VERSION | grep release | awk -F '\"' '{print $2}'
7+
VERSION=$(curl -s https://storage.googleapis.com/appengine-sdks/featured/VERSION | grep release | awk -F '\"' '{print $2}')
68
else
7-
wget -q -O - https://storage.googleapis.com/appengine-sdks/featured/VERSION | grep release | awk -F '\"' '{print $2}'
9+
VERSION=$(wget -q -O - https://storage.googleapis.com/appengine-sdks/featured/VERSION | grep release | awk -F '\"' '{print $2}')
810
fi
11+
12+
if [ VERSION="0.0.0" ]
13+
then
14+
VERSION=$LAST_KNOWN_GOOD_VERSION
15+
fi
16+
17+
echo $VERSION

0 commit comments

Comments
 (0)