Skip to content

Commit

Permalink
makes options.yaml not required
Browse files Browse the repository at this point in the history
  • Loading branch information
jenna-a2ai committed Nov 19, 2024
1 parent 8f45f20 commit 1f4b994
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions R/custom_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,19 @@ get_prepended_checklist_note <- function() {
}

get_options <- function() {
options_yaml <- file.path(.le$config_repo_path, "options.yaml")
options <- yaml::read_yaml(options_yaml)

lapply(names(options), function(option_key) {
option_value <- options[[option_key]]
assign(option_key, option_value, envir = .le)
# put in tryCatch because file may not exist
tryCatch({
options_yaml <- file.path(.le$config_repo_path, "options.yaml")
options <- yaml::read_yaml(options_yaml)

lapply(names(options), function(option_key) {
option_value <- options[[option_key]]
assign(option_key, option_value, envir = .le)
})
}, error = function(e) {
return()
})

}

capitalize <- function(word) {
Expand Down

0 comments on commit 1f4b994

Please sign in to comment.