添加 删除与安装脚本加入本地目录检查

This commit is contained in:
2026-04-15 02:04:24 +08:00
parent 6f57abda16
commit 137216623c
4 changed files with 66 additions and 29 deletions

6
install Normal file → Executable file
View 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