Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: Require
Title: Installing and Loading R Packages for Reproducible Workflows
Version: 1.0.1.9020
Date: 2025-07-16
Version: 1.0.1.9021
Date: 2025-10-17
Authors@R: c(
person("Eliot J B", "McIntire", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-6914-8316")),
Expand Down
7 changes: 3 additions & 4 deletions R/Require-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ getSHAfromGitHub <- function(acct, repo, br, verbose = getOption("Require.verbos
return(br)
}

gitRefsURL <- file.path(apiGithubDotCom, "repos", acct, repo, "git", "refs")
gitRefsURLOrig <- file.path(apiGithubDotCom, "repos", acct, repo, "git", "refs")
if (missing(br)) {
br <- "main"
}
Expand All @@ -951,6 +951,7 @@ getSHAfromGitHub <- function(acct, repo, br, verbose = getOption("Require.verbos
}

for (ii in 1:4) {
gitRefsURL <- paste0(gitRefsURLOrig, paste0("?per_page=100&page=", ii))
tf <- file.path(RequireGitHubCacheDir(), paste0("listOfRepos_", acct, "@", repo))
downloadNow <- TRUE
if (file.exists(tf)) {
Expand Down Expand Up @@ -1007,15 +1008,13 @@ getSHAfromGitHub <- function(acct, repo, br, verbose = getOption("Require.verbos
if (length(br2) > 0)
br <- br2
else {
gitRefsURL <- paste0(gitRefsURL, paste0("?per_page=100&page=", ii))
gitRefsURL <- paste0(gitRefsURLOrig, paste0("?per_page=100&page=", ii))
unlink(tf)
next
}

# br2 <- grep(unlist(gitRefsSplit2), pattern = "api.+heads/(master|main)", value = TRUE)
# br <- gsub(br2, pattern = ".+api.+heads.+(master|main).+", replacement = "\\1")
} else {

}

for (branch in br) { # will be length 1 in most cases except master/main
Expand Down
10 changes: 8 additions & 2 deletions R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -564,13 +564,19 @@ setdiffNamed <- function(l1, l2, missingFill) {
}

whereInStack <- function(obj) {
for (i in 1:sys.nframe()) {
nframes <- sys.nframe()
for (i in 1:nframes) {
fn <- get0(obj, sys.frame(-i), inherits = FALSE)
if (!is.null(fn)) {
break
}
}
return(sys.frame(-i))
if (is.null(fn)) {
ret <- NULL
} else {
ret <- sys.frame(-i)
}
return(ret)
}

getInStack <- function(obj) {
Expand Down
12 changes: 7 additions & 5 deletions R/pkgDep3.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ pkgDep <- function(packages,
purge <- purgePkgDep(purge)
# purge <- dealWithCache(purge)

if (is.null(get0("stRequire", whereInStack("stRequire")))) { # if this is NOT called from Require
on.exit(
checkAutomaticOfflineMode() # This will turn off offlineMode if it had been turned on automatically
)
}
stRequireEnv <- whereInStack("stRequire")
if (!is.null(stRequireEnv))
if (is.null(get0("stRequire", stRequireEnv))) { # if this is NOT called from Require
on.exit(
checkAutomaticOfflineMode() # This will turn off offlineMode if it had been turned on automatically
)
}

# deps <- packages
if (!includeBase) {
Expand Down
Loading