Skip to content

Commit

Permalink
Add argument 'gitignore' to taf.skeleton()
Browse files Browse the repository at this point in the history
  • Loading branch information
arni-magnusson committed Nov 26, 2023
1 parent 5a082a5 commit ae41c2c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: TAF
Version: 4.3.0
Date: 2023-11-22
Date: 2023-11-26
Title: Transparent Assessment Framework for Reproducible Research
Authors@R: c(person("Arni", "Magnusson", role=c("aut","cre"), email="[email protected]"),
person("Colin", "Millar", role="aut"),
Expand Down
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# TAF 4.3.0 (2023-11-22)
# TAF 4.3.0 (2023-11-26)

* Added function fdim() to show the dimensions of an FLR table.

* Added function taf.libraries() to load all packages from TAF library. Code
contributed by Iago Mosqueira.

* Added argument 'gitignore' to taf.skeleton() for writing a .gitignore file,
enabled by default.

* Improved draft.software() so it supports packages from r-universe. Code
contributed by Iago Mosqueira.

Expand Down
11 changes: 10 additions & 1 deletion R/taf.skeleton.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#' TAF package, i.e. \code{library(TAF)}.
#' @param model.script model script filename, either \code{model.R} (default) or
#' \code{method.R}.
#' @param gitignore whether to write a \file{.gitignore} file.
#'
#' @return Full path to analysis directory.
#'
Expand All @@ -25,7 +26,7 @@
#' @export

taf.skeleton <- function(path = ".", force = FALSE, pkgs = "TAF",
model.script = "model.R")
model.script = "model.R", gitignore=TRUE)
{
# only overwrite files if force = TRUE
safe.cat <- function(..., file, force) {
Expand Down Expand Up @@ -62,5 +63,13 @@ taf.skeleton <- function(path = ".", force = FALSE, pkgs = "TAF",
force = force)
}

if (gitignore) {
ignore <- c("/boot/data", "/boot/software", "/data",
paste0("/", file_path_sans_ext(model.script)), "/output",
"/report", "*.Rproj", ".RData", ".Rhistory", ".Rproj.user",
".Ruserdata")
write(ignore, ".gitignore")
}

invisible(getwd())
}
4 changes: 3 additions & 1 deletion man/taf.skeleton.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae41c2c

Please sign in to comment.