mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Fix gam-install.sh on Cloud Shell and MacOS 10.12
This commit is contained in:
@@ -83,8 +83,13 @@ echo -e '\x1B[0m'
|
|||||||
|
|
||||||
version_gt()
|
version_gt()
|
||||||
{
|
{
|
||||||
|
# MacOS < 10.13 doesn't support sort -V
|
||||||
|
echo "" | sort -V > /dev/null 2>&1
|
||||||
|
vsort_failed=$?
|
||||||
if [ "${1}" = "${2}" ]; then
|
if [ "${1}" = "${2}" ]; then
|
||||||
true
|
true
|
||||||
|
elif $vsort_failed; then
|
||||||
|
false
|
||||||
else
|
else
|
||||||
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"
|
test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"
|
||||||
fi
|
fi
|
||||||
@@ -184,11 +189,16 @@ try:
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
print('ERROR: assets value not found in JSON value of:\n\n%s' % release)"
|
print('ERROR: assets value not found in JSON value of:\n\n%s' % release)"
|
||||||
|
|
||||||
pycmd="python"
|
pycmd="python3"
|
||||||
$pycmd -V >/dev/null 2>&1
|
$pycmd -V >/dev/null 2>&1
|
||||||
rc=$?
|
rc=$?
|
||||||
if (( $rc != 0 )); then
|
if (( $rc != 0 )); then
|
||||||
pycmd="python3"
|
pycmd="python"
|
||||||
|
fi
|
||||||
|
$pycmd -V >/dev/null 2>&1
|
||||||
|
rc=$?
|
||||||
|
if (( $rc != 0 )); then
|
||||||
|
pycmd="python2"
|
||||||
fi
|
fi
|
||||||
$pycmd -V >/dev/null 2>&1
|
$pycmd -V >/dev/null 2>&1
|
||||||
rc=$?
|
rc=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user