Permalink
Browse files

Don't force path normalisation in case existing paths don't exist

  • Loading branch information...
hadley committed Jun 19, 2012
1 parent 8eebe9f commit 97515f00e944d2b266174ba36a22d1047d67fd7f
Showing with 3 additions and 3 deletions.
  1. +2 −2 R/path.r
  2. +1 −1 man/on_path.Rd
View
@@ -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)
@@ -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))
View
@@ -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}},

0 comments on commit 97515f0

Please sign in to comment.