Skip to content

Commit e68bd05

Browse files
committed
do not use cat
1 parent eeb7b71 commit e68bd05

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/make_cc.R

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@ make_cc <- function(file) {
2424
cppcode <- sub("(class[[:space:]][A-Za-z_][A-Za-z0-9_]*[[:space:]])",
2525
paste("#include <meta_header.hpp>\n", "\\1"), cppcode)
2626

27-
cat(readLines(dir("stan_files", pattern = "license.stan", recursive = TRUE, full.names = TRUE)),
27+
writeLines(c(readLines(dir("stan_files", pattern = "license.stan", recursive = TRUE, full.names = TRUE)),
2828
"#ifndef MODELS_HPP", "#define MODELS_HPP", "#define STAN__SERVICES__COMMAND_HPP",
2929
"#include <rstan/rstaninc.hpp>",
30-
cppcode, "#endif", file = sub("\\.stan$", ".hpp", file),
31-
sep = "\n", append = FALSE)
32-
30+
cppcode, "#endif"), con = sub("\\.stan$", ".hpp", file))
31+
3332
f <- sub("\\.stan$", "", basename(file))
3433
Rcpp::exposeClass(class = paste0("model_", f),
3534
constructors = list(c("SEXP", "SEXP", "SEXP")), fields = character(),

0 commit comments

Comments
 (0)