Răsfoiți Sursa

优化go版本号获取

Jrohy 3 ani în urmă
părinte
comite
f08963e7a5
1 a modificat fișierele cu 1 adăugiri și 0 ștergeri
  1. 1 0
      install.sh

+ 1 - 0
install.sh

@@ -138,6 +138,7 @@ installGo(){
         else
             INSTALL_VERSION=`curl -s https://github.com/golang/go/tags|grep releases/tag|grep -v rc|grep -v beta|grep -oE '[0-9]+\.[0-9]+\.?[0-9]*'|head -n 1`
         fi
+        [[ ${INSTALL_VERSION: -1} == '.' ]] && INSTALL_VERSION=${INSTALL_VERSION%?}
         [[ -z $INSTALL_VERSION ]] && { colorEcho $YELLOW "\n获取go版本号失败!"; exit 1; }
         echo "最新版golang: `colorEcho $BLUE $INSTALL_VERSION`"
         if [[ $FORCE_MODE == 0 && `command -v go` ]];then