[ports.cmake] vcpkg create: Fix the conditions for judging download result (#40956)

Co-authored-by: Monica <v-liumonica@microsoft.com>
This commit is contained in:
MonicaLiu 2024-09-24 21:10:12 +00:00 committed by GitHub
parent 43b4ba9e55
commit d07689ef16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -234,7 +234,7 @@ elseif(CMD STREQUAL "CREATE")
message(STATUS "Downloading ${URL} -> ${FILENAME}...")
file(DOWNLOAD "${URL}" "${DOWNLOAD_PATH}" STATUS download_status)
list(GET download_status 0 status_code)
if(NOT "${download_status}" EQUAL "0")
if(NOT "${status_code}" EQUAL "0")
message(FATAL_ERROR "Downloading ${URL}... Failed. Status: ${download_status}")
endif()
endif()