diff --git a/third_party/prepare.sh b/third_party/prepare.sh index 8def3c7a78c9daa6cb747037480e7cbfc94652fa..3cb6da6c61e8ded1e746e7fcee473a9138038370 100755 --- a/third_party/prepare.sh +++ b/third_party/prepare.sh @@ -4,9 +4,16 @@ cd $(dirname $0) source ../ci/utils.sh +# force use /usr/bin/sort on windows, /c/Windows/system32/sort do not support -V +OS=$(uname -s) +SORT=sort +if [[ $OS =~ "NT" ]]; then + SORT=/usr/bin/sort +fi + requiredGitVersion="1.8.4" currentGitVersion="$(git --version | awk '{print $3}')" -if [ "$(printf '%s\n' "$requiredGitVersion" "$currentGitVersion" | sort -V | head -n1)" = "$currentGitVersion" ]; then +if [ "$(printf '%s\n' "$requiredGitVersion" "$currentGitVersion" | ${SORT} -V | head -n1)" = "$currentGitVersion" ]; then echo "Please update your Git version. (foud version $currentGitVersion, required version >= $requiredGitVersion)" exit -1 fi