forked from berkeley-dsep-infra/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Source additional env vars from Renviron.site.
This should enable R and RStudio to read dynamically created files. Part of berkeley-dsep-infra#5551.
- Loading branch information
1 parent
f6ef7d5
commit f40f261
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
## Source any extra Renviron files. | ||
# | ||
# Since there is an existing /etc/R/Renviron.site file, we append this. It lets | ||
# us easily add new code via extraFiles (or other z2jh-related magic) | ||
# without having to rebuild the image each time. | ||
|
||
|
||
# Get a list of files in the directory | ||
env_dir <- "/etc/R/Renviron.site.d/" | ||
env_files <- list.files(env_dir, full.names = TRUE) | ||
|
||
# Iterate over each file | ||
for (env_file in env_files) { | ||
cat("Loading environment variables from:", env_file, "\n") | ||
|
||
# Read and parse the environment file | ||
readRenviron(env_file) | ||
} | ||
|