Skip to content

Commit 0a6df46

Browse files
authored
Merge pull request #29 from NorwegianVeterinaryInstitute/dev
NVIverse v0.5.2
2 parents 7f6b3af + 142b14e commit 0a6df46

File tree

5 files changed

+41
-18
lines changed

5 files changed

+41
-18
lines changed

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: NVIbatch
22
Title: Tools to facilitate the running of R-scripts in batch mode at NVI
3-
Version: 0.5.1
4-
Date: 2024-11-12
3+
Version: 0.5.2
4+
Date: 2024-12-13
55
Authors@R:
66
c(person(given = "Petter",
77
family = "Hopp",
@@ -16,6 +16,8 @@ URL: https://github.com/NorwegianVeterinaryInstitute/NVIbatch
1616
BugReports: https://github.com/NorwegianVeterinaryInstitute/NVIbatch/issues
1717
License: BSD_3_clause + file LICENSE
1818
Encoding: UTF-8
19+
Depends:
20+
R (>= 4.1.0)
1921
Imports:
2022
checkmate (>= 2.1.0),
2123
remotes,
@@ -41,5 +43,3 @@ Roxygen: list(markdown = FALSE)
4143
VignetteBuilder: knitr
4244
Language: en-GB
4345
RoxygenNote: 7.3.1
44-
Depends:
45-
R (>= 3.0.0)

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# NVIbatch 0.5.2 - (2024-12-13)
2+
3+
## Bug fixes:
4+
5+
- `use_NVIverse` sets `build_vignettes` = `FALSE` if necessary packages for building vignettes are not installed.
6+
7+
18
# NVIbatch 0.5.1 - (2024-11-12)
29

310
## New features:

R/use_NVIverse.R

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#' @param pkg [\code{character}]\cr
88
#' Name of one or more \code{NVIverse} packages.
99
#' @param auth_token [\code{character}]\cr
10-
#' To install \code{NVIconfig} a personal access token is needed. Generate a personal
11-
#' access token (PAT) in "https://github.com/settings/tokens" and
10+
#' To install \code{NVIconfig} a personal access token is needed. Generate a
11+
#' personal access token (PAT) in "https://github.com/settings/tokens" and
1212
#' supply to this argument. Defaults to \code{NULL}.
1313
#' @param dependencies [\code{logical(1) | character}]\cr
1414
#' The dependencies to check and eventually install. Can be
@@ -20,16 +20,17 @@
2020
#' and is the default.
2121
#' @param upgrade [\code{logical(1) | character(1)}]\cr
2222
#' Should package dependencies be upgraded? One of c("ask", "always", "never").
23-
#' \code{TRUE} and \code{FALSE} are also accepted and correspond to "always" and "never"
24-
#' respectively. Defaults to \code{FALSE}.
23+
#' \code{TRUE} and \code{FALSE} are also accepted and correspond to
24+
#' "always" and "never" respectively. Defaults to \code{FALSE}.
2525
#' @param build [\code{logical(1)}]\cr
2626
#' If \code{TRUE} build the package before installing. Defaults to \code{TRUE}.
2727
#' @param build_manual [\code{logical(1)}]\cr
2828
#' If \code{FALSE}, don't build PDF manual ('--no-manual').
2929
#' Defaults to \code{FALSE}.
3030
#' @param build_vignettes [\code{logical(1)}]\cr
3131
#' If \code{FALSE}, don't build package vignettes ("--no-build-vignettes").
32-
#' Defaults to \code{TRUE}.
32+
#' Defaults to \code{TRUE}, but is set to \code{FALSE} if necessary packages
33+
#' for building vignettes are not installed.
3334
#' @param \dots Other arguments to be passed to
3435
#' \ifelse{html}{\code{\link[remotes:install_github]{remotes::install_github}}}{\code{remotes::install_github}}.
3536

@@ -45,6 +46,20 @@ use_NVIverse <- function(pkg,
4546
build_manual = FALSE,
4647
build_vignettes = TRUE,
4748
...) {
49+
50+
# PREPARE ARGUMENTS BEFORE CHECKING ----
51+
## Change build_vignettes to FALSE if packages to build vignettes is lacking
52+
## Building the vignettes requires knitr, rmarkdown, R.rsp and NVIrpackages
53+
if (isTRUE(build_vignettes)) {
54+
if (!isTRUE(NVIcheckmate::check_package(x = "knitr")) |
55+
!isTRUE(NVIcheckmate::check_package(x = "rmarkdown")) |
56+
!isTRUE(NVIcheckmate::check_package(x = "R.rsp")) |
57+
!isTRUE(NVIcheckmate::check_package(x = "NVIrpackages"))) {
58+
warning("Vignettes are not built as necessary packages for building vignettes are not installed.")
59+
build_vignettes <- FALSE
60+
}
61+
}
62+
4863
# ARGUMENT CHECKING ----
4964
# Check that NVIcheckmate is installed to avoid using NVIcheckmate functions if not installed
5065
NVIcheckmate_installed <- FALSE

man/use_NVIverse.Rd

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

notes/get_filepath.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ nodename
6565
library(tidyverse)
6666
getCurrentFileLocation <- function()
6767
{
68-
this_file <- commandArgs() %>%
69-
tibble::enframe(name = NULL) %>%
70-
tidyr::separate(col=value, into=c("key", "value"), sep="=", fill='right') %>%
71-
dplyr::filter(key == "--file") %>%
68+
this_file <- commandArgs() |>
69+
tibble::enframe(name = NULL) |>
70+
tidyr::separate(col=value, into=c("key", "value"), sep="=", fill='right') |>
71+
dplyr::filter(key == "--file") |>
7272
dplyr::pull(value)
7373
if (length(this_file)==0)
7474
{

0 commit comments

Comments
 (0)