Skip to content

Commit

Permalink
Use shorter URL for OMERO_LIBS_DOWNLOAD
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikl committed Aug 7, 2019
1 parent 0abb93a commit 203f6b0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@

getLibs <- Sys.getenv("OMERO_LIBS_DOWNLOAD", unset = NA)
if (!is.na(getLibs) && startsWith(tolower(getLibs), 'http')) {
# Allows using Java libs from merge-ci builds, e.g.
# https://merge-ci.openmicroscopy.org/jenkins/job/OMERO-build/lastBuild/
git_info <- GET(getLibs)
status <- status_code(git_info)
if (status != 200) {
packageStartupMessage("Request failed. ", getLibs, " returned ", status)
acc <- 'n'
} else {
git_info <- content(git_info, "text")
ex <- "(OMERO\\.java-\\S+\\.zip)"
ex <- ">(OMERO\\.java-\\S+\\.zip)<"
r <- gregexpr(ex, git_info)
res <- regmatches(git_info, r)
zipFile <- res[[1]][[2]]
zipFile <- substr(res[[1]], 2, nchar(res[[1]])-1)
baseURL <- getLibs
if (endsWith(getLibs, '/'))
baseURL <- substr(baseURL, 1, nchar(baseURL)-1)
baseURL <- paste(baseURL, "artifact/src/target", sep = '')
else
baseURL <- paste(baseURL, "artifact/src/target", sep = '/')
acc <- 'y'
}
}
Expand Down

0 comments on commit 203f6b0

Please sign in to comment.