Skip to content

Commit

Permalink
revert rm download.file
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotmcintire committed Aug 6, 2024
1 parent 7c723de commit 2fc7996
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions R/Require-helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -1405,15 +1405,15 @@ masterMainHEAD <- function(url, need) {
for (tryNum in 1:2) {
if (!isTRUE(getOption("Require.offlineMode"))) {

# if (is.null(token)) {
# tryCatch(download.file(URL, destfile = df, quiet = TRUE),# need TRUE to hide ghp
# error = function(e) {
# if (is.null(token))
# e$message <- stripGHP(ghp, e$message)
# if (tryNum > 1)
# messageVerbose(e$message, verbose = verbose)
# })
# } else {
if (is.null(token)) {
tryCatch(download.file(URL, destfile = df, quiet = TRUE),# need TRUE to hide ghp
error = function(e) {
if (is.null(token))
e$message <- stripGHP(ghp, e$message)
if (tryNum > 1)
messageVerbose(e$message, verbose = verbose)
})
} else {
a <- try(GETWauthThenNonAuth(url, token, verbose = verbose))
if (is(a, "try-error")) {
if (any(grepl("Could not resolve host", a))) {
Expand All @@ -1426,7 +1426,7 @@ masterMainHEAD <- function(url, need) {
# a <- httr::GET(url, httr::add_headers())
data <- httr::content(a, "raw")
writeBin(data, df)
# }
}
if (file.exists(df))
break
if (is.null(token))
Expand Down

0 comments on commit 2fc7996

Please sign in to comment.