Skip to content

Commit f2b77fa

Browse files
author
Eliot McIntire
committed
correct the google auth when don't have the json file
1 parent 79b4b9e commit f2b77fa

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ URL:
1919
https://reproducible.predictiveecology.org,
2020
https://github.com/PredictiveEcology/reproducible
2121
Date: 2025-12-16
22-
Version: 2.1.3.9001
22+
Version: 2.1.3.9002
2323
Authors@R:
2424
c(person(given = "Eliot J B",
2525
family = "McIntire",

tests/testthat/helper-allEqual.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ testInit <- function(libraries = character(), ask = FALSE, verbose, tmpFileExt =
9696
if (!nzchar(Sys.getenv("GOOGLEDRIVE_AUTH"))) {
9797
Sys.setenv("GOOGLEDRIVE_AUTH" = "~/genial-cycling-408722-788552a3ecac.json")
9898
}
99-
googledrive::drive_auth(path = Sys.getenv("GOOGLEDRIVE_AUTH"))
99+
gauthEnv <- Sys.getenv("GOOGLEDRIVE_AUTH")
100+
if (nzchar(gauthEnv)) {
101+
if (file.exists(gauthEnv))
102+
googledrive::drive_auth(path = gauthEnv)
103+
# googledrive::drive_auth(path = Sys.getenv("GOOGLEDRIVE_AUTH"))
104+
}
100105
}
101106

102107

tests/testthat/setup.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@ opts <- options(
3232
# Whatever files are on googledrive must be shared with this google service account
3333
if (isNamespaceLoaded("googledrive"))
3434
if ((!googledrive::drive_has_token())) {
35-
if (nzchar(Sys.getenv("GOOGLEDRIVE_AUTH"))) {
36-
googledrive::drive_auth(path = Sys.getenv("GOOGLEDRIVE_AUTH"))
35+
gauthEnv <- Sys.getenv("GOOGLEDRIVE_AUTH")
36+
if (nzchar(gauthEnv)) {
37+
if (file.exists(gauthEnv))
38+
googledrive::drive_auth(path = gauthEnv)
3739
}
3840
}
3941

0 commit comments

Comments
 (0)