添加 删除与安装脚本加入本地目录检查
This commit is contained in:
6
install
Normal file → Executable file
6
install
Normal file → Executable file
@@ -35,13 +35,13 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
# Version Check
|
||||
# Version History Check
|
||||
TEXT=$(
|
||||
curl -s https://terraria.wiki.gg/wiki/Desktop_version_history | tr '\n' ' ' | grep -oP '(?<=<tbody>).*?(?=</tbody>)'
|
||||
)
|
||||
ALL_VERSIONS=$(echo "$TEXT" | grep -oP '[0-9]+\.[0-9]+(\.[0-9]+)?+(\.[0-9]+)?')
|
||||
VERSION=$(echo "$ALL_VERSIONS" | head -n1)
|
||||
VERSION_NO_DOT=$(echo "$VERSION" | tr -d '.')
|
||||
LATEST_VERSION=$(printf "%s\n" "$ALL_VERSIONS" | head -n1)
|
||||
VERSION_NO_DOT=$(echo "$LATEST_VERSION" | tr -d '.')
|
||||
if [[ $1 == 'latest' ]]; then
|
||||
echo "Latest version: $VERSION"
|
||||
VERSION=$VERSION_NO_DOT
|
||||
|
||||
Reference in New Issue
Block a user