Skip to content

Commit b6d19e9

Browse files
committed
skip example 005 for R < 4.1.0, and use git diff --quiet to test differences (since [ -z ] doesn't work on Windows)
1 parent ae13af0 commit b6d19e9

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
working-directory: examples
8181
run: |
8282
Rscript _run.R
83-
[ -z "$(git diff)" ] || (git diff && echo "Examples output changed" 1>&2 && exit 1)
83+
git diff --quiet || (git diff && exit 1)
8484
8585
- name: Test coverage
8686
if: success() && env.USE_R_CODECOV == 'true'

examples/_run.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ for (f in litedown:::find_input('.')) {
77
m = file.mtime(c(f, f2 <- xfun::with_ext(f, '.md')))
88
if (!is.na(m[2]) && m[1] < m[2]) next
99
}
10+
# example 005 uses |>, which is available only in R >= 4.1.0
11+
if (grepl('^005-', f) && getRversion() < '4.1.0') next
1012
xfun::Rscript_call(function(.) {
1113
options(width = 80, litedown.jsd_resolve = FALSE)
1214
if (xfun::file_ext(.) == 'md') litedown::mark(.) else litedown::fuse(., '.md')
13-
if (grepl('/014-.+[.]Rmd$', .)) litedown::fiss(.)
15+
if (grepl('^014-.+[.]Rmd$', .)) litedown::fiss(.)
1416
}, list(f))
1517
}

0 commit comments

Comments
 (0)