R/config.R

fetch = function(var) {
  value = Sys.getenv(var)

  if(value == '') stop(var, ' is not set. Add to .Renviron')
  value
}

source_dir = function()    fetch("SOURCE_DIR")
processed_dir = function() fetch("PROCESSED_DIR")
shared_dir = function()    fetch('SHARED_DIR')
tomasukun/prescribr documentation built on May 31, 2019, 6:10 p.m.