Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Added github branch installation (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
brnleehng authored Sep 12, 2018
1 parent 1d26dd8 commit 4020a93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion inst/startup/install_github.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ jobPrepDirectory <- Sys.getenv("AZ_BATCH_JOB_PREP_WORKING_DIR")
.libPaths(c(jobPrepDirectory, "/mnt/batch/tasks/shared/R/packages", .libPaths()))
status <- tryCatch({
for (package in args) {
packageDirectory <- strsplit(package, "/")[[1]]
packageVersion <- strsplit(package, "@")[[1]]

if (length(packageVersion) > 1) {
packageDirectory <- strsplit(packageVersion[1], "/")[[1]]
}
else {
packageDirectory <- strsplit(package, "/")[[1]]
}

packageName <- packageDirectory[length(packageDirectory)]

if (!require(packageName, character.only = TRUE)) {
Expand Down
10 changes: 9 additions & 1 deletion inst/startup/worker.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ for (package in azbatchenv$packages) {
}

for (package in azbatchenv$github) {
packageDirectory <- strsplit(package, "/")[[1]]
packageVersion <- strsplit(package, "@")[[1]]

if (length(packageVersion) > 1) {
packageDirectory <- strsplit(packageVersion[1], "/")[[1]]
}
else {
packageDirectory <- strsplit(package, "/")[[1]]
}

packageName <- packageDirectory[length(packageDirectory)]

library(packageName, character.only = TRUE)
Expand Down

0 comments on commit 4020a93

Please sign in to comment.