提交 bc2b8d6f 编写于 作者: M Megvii Engine Team

fix(windows/fix-prepare): fix prepare on windows

GitOrigin-RevId: 04e89c28e76fb8690627d1458d347f0a7b797d29
上级 ace020c5
...@@ -4,9 +4,16 @@ cd $(dirname $0) ...@@ -4,9 +4,16 @@ cd $(dirname $0)
source ../ci/utils.sh 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" requiredGitVersion="1.8.4"
currentGitVersion="$(git --version | awk '{print $3}')" 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)" echo "Please update your Git version. (foud version $currentGitVersion, required version >= $requiredGitVersion)"
exit -1 exit -1
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册