From 20b85b32e2e4daddc3591605089ca90fb5be2064 Mon Sep 17 00:00:00 2001 From: LouiseDck Date: Thu, 12 Dec 2024 21:39:52 +0100 Subject: [PATCH] fix system command --- .github/workflows/R-CMD-check.yaml | 11 ++++------- tests/testthat/helper-skip_if_no_h5diff.R | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 75ea0be..fd021c0 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -65,13 +65,10 @@ jobs: shell: Rscript {0} - name: Install h5diff - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - sudo apt-get install hdf5-tools - else - echo "$RUNNER_OS not supported" - exit 1 - fi + run: | + if [ "$RUNNER_OS" == "Linux" ]; then + sudo apt-get install hdf5-tools + fi shell: bash diff --git a/tests/testthat/helper-skip_if_no_h5diff.R b/tests/testthat/helper-skip_if_no_h5diff.R index 7e31f79..8368324 100644 --- a/tests/testthat/helper-skip_if_no_h5diff.R +++ b/tests/testthat/helper-skip_if_no_h5diff.R @@ -1,7 +1,7 @@ # helper function to skip tests if h5diff is not available skip_if_no_h5diff <- function(){ testthat::skip_if( - !system("h5diff", intern = TRUE), + !system("which h5diff", ignore.stdout = TRUE), message = "h5diff not available for testing" ) } \ No newline at end of file