Handle package files that failed to download
This commit is contained in:
parent
f6f31bf6e6
commit
3a62186e55
1 changed files with 7 additions and 1 deletions
|
@ -50,7 +50,13 @@ include(ExternalProject)
|
||||||
|
|
||||||
function(DubProject_Add name)
|
function(DubProject_Add name)
|
||||||
if(NOT EXISTS ${DUB_DIRECTORY}/${name}.json)
|
if(NOT EXISTS ${DUB_DIRECTORY}/${name}.json)
|
||||||
file(DOWNLOAD ${DUB_REGISTRY}/${name}.json ${DUB_DIRECTORY}/${name}.json)
|
file(DOWNLOAD ${DUB_REGISTRY}/${name}.json ${DUB_DIRECTORY}/${name}.json STATUS status)
|
||||||
|
list(GET status 0 statusCode)
|
||||||
|
|
||||||
|
if(NOT statusCode EQUAL 0)
|
||||||
|
file(REMOVE ${DUB_DIRECTORY}/${name}.json)
|
||||||
|
message(FATAL_ERROR "Failed to download ${DUB_REGISTRY}/${name}.json")
|
||||||
|
endif(NOT statusCode EQUAL 0)
|
||||||
endif(NOT EXISTS ${DUB_DIRECTORY}/${name}.json)
|
endif(NOT EXISTS ${DUB_DIRECTORY}/${name}.json)
|
||||||
|
|
||||||
if(${ARGC} GREATER 1)
|
if(${ARGC} GREATER 1)
|
||||||
|
|
Loading…
Reference in a new issue