dot dot dotfiles
1#!/usr/bin/env Rscript
2
3if ("src" %in% list.files (here::here ())) {
4 f <- list.files (file.path (here::here (), "src"),
5 full.names = TRUE,
6 pattern = "\\.h$|\\.hpp$|\\.c$|\\.cpp$")
7 debug_active <- vapply (f, function (i) {
8 x <- readLines (i)
9 any (grepl ("^#define DEBUG$", x)) },
10 logical (1))
11 if (any (debug_active))
12 stop ("src files have active debug lines")
13}