diff --git a/R/conf.R b/R/conf.R index 14c01e2..c9fbc11 100644 --- a/R/conf.R +++ b/R/conf.R @@ -11,11 +11,11 @@ NULL # sources 1 config file and returns the envir -sourceConfFile = function(conffile) { +sourceConfFile = function(conffile, ...) { assertFile(conffile) conf = new.env() - x = try(sys.source(conffile, envir = conf)) + x = try(sys.source(conffile, envir = conf, ...)) if (is.error(x)) stopf("There was an error in sourcing your configuration file '%s': %s!", conffile, as.character(x)) checkConf(conf) @@ -205,12 +205,14 @@ print.Config = function(x, ...) { #' @param conffile [\code{character(1)}]\cr #' Location of the configuration file to load. #' Default is \dQuote{.BatchJobs.conf} in the current working directory. +#' @param ... +#' Further arguments to \code{sys.source} (currently just \code{chdir}) #' @return Invisibly returns a list of configuration settings. #' @family conf #' @export -loadConfig = function(conffile = ".BatchJobs.R") { +loadConfig = function(conffile = ".BatchJobs.R", ...) { # checks are done in sourceConfFile - conf = sourceConfFile(conffile) + conf = sourceConfFile(conffile, ...) assignConf(conf) invisible(setClasses(as.list(conf), "Config")) } diff --git a/man/loadConfig.Rd b/man/loadConfig.Rd index a0e4f18..b2f0d07 100644 --- a/man/loadConfig.Rd +++ b/man/loadConfig.Rd @@ -4,12 +4,14 @@ \alias{loadConfig} \title{Load a specific configuration file.} \usage{ -loadConfig(conffile = ".BatchJobs.R") +loadConfig(conffile = ".BatchJobs.R", ...) } \arguments{ \item{conffile}{[\code{character(1)}]\cr Location of the configuration file to load. Default is \dQuote{.BatchJobs.conf} in the current working directory.} + +\item{...}{Further arguments to \code{sys.source} (currently just \code{chdir})} } \value{ Invisibly returns a list of configuration settings.