Skip to content

Commit

Permalink
Update auto_commit.sh, add empty check
Browse files Browse the repository at this point in the history
  • Loading branch information
LucienShui committed Nov 23, 2024
1 parent 12b8147 commit fe00f0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 10 additions & 2 deletions auto_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@ parse_version_list() {
}

main() {
ONLINE_LATEST_VERSION="$(curl -sSL 'https://www.ikuai8.com/component/download' | grep 'btn btn_64' | grep "iso" | awk -F 'x64_' '{ print $2 }' | awk -F '.iso' '{ print $1 }')"
LOCAL_LATEST_VERSION="$(head -n 1 version_list.txt)"
if [ -z "${LOCAL_LATEST_VERSION}" ]; then
echo "Error: LOCAL_LATEST_VERSION is empty."
exit 1
fi

ONLINE_LATEST_VERSION="$(curl -sSL 'https://www.ikuai8.com/component/download' | grep 'btn btn_64' | grep "iso" | awk -F 'x64_' '{ print $2 }' | awk -F '.iso' '{ print $1 }')"
if [ -z "${ONLINE_LATEST_VERSION}" ]; then
echo "Error: ONLINE_LATEST_VERSION is empty."
exit 1
fi

if [ "${LOCAL_LATEST_VERSION}" != "${ONLINE_LATEST_VERSION}" ]; then
BUF_FILE="${TMP_DIR}/version_list.txt"
Expand Down Expand Up @@ -104,4 +112,4 @@ EOF
fi
}

main
main
1 change: 0 additions & 1 deletion version_list.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
3.7.16_Build202411141700
3.7.15_Build202409251708
3.7.14_Build202408011011
3.7.13_Build202406212115
Expand Down

0 comments on commit fe00f0c

Please sign in to comment.