Browse Source

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

release-1.1
zhanghaolong Xinran Xu 4 years ago
parent
commit
e8ea6dd523
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      third_party/prepare.sh

+ 8
- 1
third_party/prepare.sh View File

@@ -2,9 +2,16 @@


cd $(dirname $0) cd $(dirname $0)


# 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


Loading…
Cancel
Save