-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathapp_config.R
36 lines (34 loc) · 1.07 KB
/
app_config.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#' Access files in the current app
#'
#' @param ... Character vector specifying directory and or file to point to inside the current package.
#'
#' @noRd
app_sys <- function(...) {
system.file(..., package = "biodosetools")
}
#' Read App Config
#'
#' @param value Value to retrieve from the config file.
#' @param config GOLEM_CONFIG_ACTIVE value. If unset, R_CONFIG_ACTIVE.
#' If unset, "default".
#' @param use_parent Logical, scan the parent directory for config file.
#' @param file Location of the config file.
#'
#' @noRd
get_golem_config <- function(value,
config = Sys.getenv(
"GOLEM_CONFIG_ACTIVE",
Sys.getenv(
"R_CONFIG_ACTIVE",
"default"
)
),
use_parent = TRUE,
file = app_sys("golem-config.yml")) {
config::get(
value = value,
config = config,
file = file,
use_parent = use_parent
)
}