Rather than check out a release repo to see if it exists or not use git ls-remote to establish if it exists

This commit is contained in:
Dan Hawkins 2019-05-03 15:20:36 +01:00
commit 9af654fb28

View file

@ -119,14 +119,12 @@ def checkRepoExists(String gitURL) {
if (isUnix()) {
result = sh( script: """
git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
if [ \$? -ne 0 ]; then exit 1; fi
""",
returnStatus: true
)
} else {
result = bat( script: """
git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
if errorlevel 1 EXIT /b 1
@git ls-remote "${gitURL}" CHECK_GIT_REMOTE_URL_REACHABILITY
""",
returnStatus: true
)