Commit 8b251e46 authored by Gjalt-Jorn Peters's avatar Gjalt-Jorn Peters

Ignoring some primary sources

parent 3025d838
Pipeline #73002864 failed with stages
in 13 minutes and 34 seconds
......@@ -2,10 +2,12 @@
#' @param recursive Whether to search all subdirectories (`TRUE`) as well or not.
#' @param filenameRegex A regular expression to match against located files; only
#' files matching this regular expression are processed.
#' @param ignoreRegex Regular expression indicating which files to ignore.
#' @export
load_sources <- function(input,
encoding="UTF-8",
filenameRegex=".*",
ignoreRegex=NULL,
recursive=TRUE,
full.names=FALSE,
silent=FALSE) {
......@@ -26,6 +28,13 @@ load_sources <- function(input,
recursive=recursive,
full.names=TRUE);
if (!is.null(ignoreRegex)) {
rawSourceFiles <-
rawSourceFiles[!grepl(ignoreRegex,
rawSourceFiles,
perl=TRUE)];
}
res <- list();
for (filename in rawSourceFiles) {
fileNameToUse <-
......
......@@ -4,6 +4,7 @@ merge_sources <- function(input,
outputPrefix = "",
outputSuffix = "_merged",
primarySourcesRegex=".*",
primarySourcesIgnoreRegex=outputSuffix,
primarySourcesPath = input,
coderId = "\\[\\[coderId=([a-zA-Z0-9._-]+)\\]\\]",
idForOmittedCoderIds = "noCoderId",
......@@ -38,6 +39,7 @@ merge_sources <- function(input,
args <-
args[setdiff(names(args),
c('primarySourcesRegex',
'primarySourcesIgnoreRegex',
'primarySourcesPath',
'primarySourcesRecursive',
'output',
......@@ -70,8 +72,12 @@ merge_sources <- function(input,
filenameRegex=primarySourcesRegex,
recursive=primarySourcesRecursive,
full.names=TRUE,
ignoreRegex=primarySourcesIgnoreRegex,
silent=silent);
primarySources
primarySourcesIgnoreRegex
if (!(tolower(output) == "same")) {
if (!dir.exists(output)) {
warning("Directory provided to write to ('",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment