X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=R%2Fload.R;h=646f60d724d9ee808e647513d5e4e5056293282e;hb=HEAD;hp=4f74839126e53b1dddf5ca9538c8ccb42deebd7f;hpb=156f8ca651789536f3c0efd2af6c97f8b8e9eb54;p=pkgdev.git diff --git a/R/load.R b/R/load.R index 4f74839..646f60d 100644 --- a/R/load.R +++ b/R/load.R @@ -18,7 +18,7 @@ if (fileOrDir != forbiddenPath) { if (file.info(fileOrDir)$isdir) { rFiles = list.files(fileOrDir, pattern="\\.[RrSsq]$", - full.names=TRUE, recursive=TRUE) + full.names=TRUE, recursive=TRUE) # NOTE: potential unexported functions are not hidden; # the developer is assumed to handle this lapply(rFiles, source) @@ -33,15 +33,15 @@ # This file tells if the package is currently loaded pkgLoadFile = file.path(pkdev_path,"pkgs",pkgName,"loaded") - + if (file.exists(file.path(path,"src"))) { # C code -- Warning: src/tests folder should not be listed cFiles = c( - list.files( file.path(path,"src","adapters"), pattern="\\.[cChH]$", - full.names=TRUE, recursive=TRUE ), - list.files( file.path(path,"src","sources"), pattern="\\.[cChH]$", - full.names=TRUE, recursive=TRUE )) - + list.files(file.path(path,"src","sources"),pattern="\\.[cChH]$", + full.names=TRUE, recursive=TRUE, no..=TRUE), + list.files(file.path(path,"src","adapters"),pattern="\\.[cChH]$", + full.names=TRUE, recursive=TRUE, no..=TRUE)) + # Create folder R_HOME_USER/pkgdev/pkgs/pkgName/src (if not existing) dir.create(file.path(pkdev_path,"pkgs",pkgName,"src"), showWarnings=FALSE) @@ -64,7 +64,7 @@ } # Mark package as 'loaded' - writeLines("loaded",pkgLoadFile) + file.create(pkgLoadFile) } # Generate appropriate Makefile under R_HOME_USER/pkgdev/pkgs/pkgName/src