-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
The package vignette fails in windows, in the step makeSingleGRANRepo().
I traced the first problem to normalizePath2(), where the code makes some assumptions about path names that don't seem to hold for Windows.
Reproducible example:
repdir = file.path(tempdir(), "repos")
> normalizePath2(repdir)
[1] "C:/Users/Andrie/Documents/GitHub/gRAN/C:\\Users\\Andrie\\AppData\\Local\\Temp\\RtmpszdDv8/repos"
Note the ..../gRAN/C::\\Users\\...
If I rewrite normalizePath2() by commenting out four lines toward the bottom, this problem goes away on Windows, but I don't know what the impact will be on other operating systems.
normalizePath2 = function(path, follow.symlinks=FALSE)
{
if(follow.symlinks)
normalizePath(path)
else {
path <- path.expand(path)
fileSep <- .Platform$file.sep
wd <- getwd()
if(substr(path, 1, 1) == "~")
path = path.expand(path)
##paths starting with / for example
else if(substr(path, 1, 1) == fileSep)
path = path
else if (substr(path, 1, 2) == "..") {
tmppath = wd
while(substr(path, 1, 2) == "..") {
tmppath = dirname(tmppath)
path = substr(path, 3, nchar(path))
if(substr(path, 1, 1) == fileSep)
path = substr(path, 2, nchar(path))
}
path = file.path(tmppath, path)
}
# else if(grepl("^\\.*[[:alnum:]]", path))
# path = file.path(wd, path)
# else if (substr(path, 1,1) == ".")
# path = file.path(wd, substr(path,2, nchar(path)))
path = gsub(paste(rep(fileSep, 2), collapse=""), fileSep, path, fixed=TRUE)
path
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels