mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-02 15:36:41 -05:00
prepend 'v' to version numbers
This commit is contained in:
parent
336d28c29e
commit
d83959569d
@ -194,8 +194,14 @@ getVersion(){
|
|||||||
VER=`/usr/bin/v2ray/v2ray -version 2>/dev/null`
|
VER=`/usr/bin/v2ray/v2ray -version 2>/dev/null`
|
||||||
RETVAL="$?"
|
RETVAL="$?"
|
||||||
CUR_VER=`echo $VER | head -n 1 | cut -d " " -f2 | cut -d. -f-2`
|
CUR_VER=`echo $VER | head -n 1 | cut -d " " -f2 | cut -d. -f-2`
|
||||||
|
if [[ ${CUR_VER} != v* ]]; then
|
||||||
|
CUR_VER=v${CUR_VER}
|
||||||
|
fi
|
||||||
TAG_URL="https://api.github.com/repos/v2ray/v2ray-core/releases/latest"
|
TAG_URL="https://api.github.com/repos/v2ray/v2ray-core/releases/latest"
|
||||||
NEW_VER=`curl ${PROXY} -s ${TAG_URL} --connect-timeout 10| grep 'tag_name' | cut -d\" -f4`
|
NEW_VER=`curl ${PROXY} -s ${TAG_URL} --connect-timeout 10| grep 'tag_name' | cut -d\" -f4`
|
||||||
|
if [[ ${NEW_VER} != v* ]]; then
|
||||||
|
NEW_VER=v${NEW_VER}
|
||||||
|
fi
|
||||||
if [[ $? -ne 0 ]] || [[ $NEW_VER == "" ]]; then
|
if [[ $? -ne 0 ]] || [[ $NEW_VER == "" ]]; then
|
||||||
colorEcho ${RED} "Failed to fetch release information. Please check your network or try again."
|
colorEcho ${RED} "Failed to fetch release information. Please check your network or try again."
|
||||||
return 3
|
return 3
|
||||||
|
Loading…
Reference in New Issue
Block a user