Skip to content

Commit

Permalink
search config file in user directory
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k authored and jimhester committed Nov 2, 2017
1 parent 22d7499 commit c392b00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' \item options defined as \code{linter.setting}.
#' \item \code{linter_file} in the same directory
#' \item \code{linter_file} in the project directory
#' \item \code{linter_file} in the user home directory
#' \item \code{\link{default_settings}}
#' }
#'
Expand Down Expand Up @@ -74,6 +75,14 @@ find_config <- function(filename) {
return(linter_config)
}

## next check for a file in the user directory
# cf: rstudio@bc9b6a5 SessionRSConnect.R#L32
home_dir <- Sys.getenv("HOME", unset = "~")
linter_config <- file.path(home_dir, linter_file)
if (isTRUE(file.exists(linter_config))) {
return(linter_config)
}

NULL
}

Expand Down

0 comments on commit c392b00

Please sign in to comment.