修复 rsshub 版本号匹配

Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
新疆萌森软件开发工作室 2024-10-18 12:30:06 +08:00
parent fcbf0555b7
commit 02f22ec9b9

View File

@ -28,13 +28,13 @@ process_image() {
echo "Trimmed version: $trimmed_version"
# Remove any suffixes (like -ffmpeg) for versioning purposes
cleaned_version=$(echo "$trimmed_version" | grep -oE '[0-9]+(\.[0-9]+){0,4}')
cleaned_version=$(echo "$trimmed_version" | grep -oE '^[0-9]+(\.[0-9]+){0,3}$')
echo "Cleaned version: $cleaned_version"
# Handle special versions with dates and other formats
if [[ -z "$cleaned_version" ]]; then
cleaned_version=$(echo "$trimmed_version" | grep -oE '[0-9]{4}-[0-9]{2}-[0-9]{2}')
cleaned_version=$(echo "$trimmed_version" | grep -oE '^[0-9]{4}-[0-9]{2}-[0-9]{2}$')
fi
echo "Final version: $cleaned_version"