🎉 Added duf

This commit is contained in:
2021-08-23 13:03:48 +02:00
parent 76afab8189
commit 6e23d82c0a
6 changed files with 71 additions and 14 deletions

View File

@@ -1,6 +1,15 @@
message("TOOL \"${TOOL}\" REPO \"${REPO}\"")
macro(mgs text)
execute_process(COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --green --bold ${text})
endmacro()
SET(URL "https://api.github.com/repos/${REPO}/${TOOL}/releases/latest")
string(REPLACE "/" ";" RLIST "${GH_REPO}")
list(GET RLIST 0 OWNER)
list(GET RLIST 1 TOOL)
mgs("TOOL \"${TOOL}\" OWNER \"${OWNER}\"")
SET(URL "https://api.github.com/repos/${OWNER}/${TOOL}/releases/latest")
execute_process(COMMAND curl -s -L ${URL} OUTPUT_VARIABLE VERSION_JSON)
string(JSON VERSION_DIRTY GET ${VERSION_JSON} tag_name)
@@ -8,5 +17,5 @@ string(JSON VERSION_DIRTY GET ${VERSION_JSON} tag_name)
string(REGEX REPLACE [^0-9\\.] "" VERSION "${VERSION_DIRTY}")
string(REPLACE "." "_" VERSION_UNDERSCORE ${VERSION})
message("Latest VERSION ${VERSION}")
mgs("Latest VERSION ${VERSION}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/templates/install-${TOOL}.sh.in" "${CMAKE_CURRENT_LIST_DIR}/install-${TOOL}.sh" @ONLY)