Created
February 22, 2019 11:05
-
-
Save kevinrue/b3f0076874dbb036ea9d2a1fa87db117 to your computer and use it in GitHub Desktop.
Clone the content of an R package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clonePackageSource <- function(from, to, ignore=c(".git")) { | |
unisetRootFiles <- list.files(cloneSourceFolder, all.files = TRUE, include.dirs = TRUE) | |
unisetRootFiles <- setdiff(unisetRootFiles, c(".", "..", ".git")) | |
dir.create(cloneDestinationFolder, recursive = TRUE) | |
for (rootFile in unisetRootFiles) { | |
message(rootFile) | |
file.copy( | |
from = file.path(cloneSourceFolder, rootFile), | |
to = file.path(cloneDestinationFolder), | |
recursive = TRUE, overwrite = TRUE) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment