Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't force path normalisation in case existing paths don't exist
  • Loading branch information
hadley committed Jun 19, 2012
1 parent 8eebe9f commit 97515f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/path.r
Expand Up @@ -24,7 +24,7 @@ get_path <- function() {
#' @export
#' @rdname path
set_path <- function(path) {
path <- normalizePath(path, mustWork = TRUE)
path <- normalizePath(path, mustWork = FALSE)

old <- get_path()
path <- paste(path, collapse = .Platform$path.sep)
Expand All @@ -51,7 +51,7 @@ add_path <- function(path, after = Inf) {
#' on_path("R")
#' on_path("gcc")
#' on_path("foo", "bar") # FALSE in most cases
#' with_path(".", on_path("gcc"))
#' with_path(tempdir(), on_path("gcc"))
on_path <- function(...) {
commands <- c(...)
stopifnot(is.character(commands))
Expand Down
2 changes: 1 addition & 1 deletion man/on_path.Rd
Expand Up @@ -15,7 +15,7 @@
on_path("R")
on_path("gcc")
on_path("foo", "bar") # FALSE in most cases
with_path(".", on_path("gcc"))
with_path(tempdir(), on_path("gcc"))
}
\seealso{
Other path: \code{\link{add_path}},
Expand Down

0 comments on commit 97515f0

Please sign in to comment.