Skip to content
This repository has been archived by the owner on Jan 3, 2018. It is now read-only.

Commit

Permalink
Merge pull request #271 from fmichonneau/check-knitr-version
Browse files Browse the repository at this point in the history
[fix #270] check knitr version before converting Rmd to md
  • Loading branch information
Raniere Silva committed Jun 30, 2015
2 parents c19c252 + 926c4d8 commit a7c7240
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ preview : $(DST_ALL)
-o $@ $<

# Pattern to convert R Markdown to Markdown.
%.md: %.Rmd $(R_CHUNK_OPTS)
%.md: %.Rmd $(R_CHUNK_OPTS) tools/check_knitr_version.R
Rscript -e "source('tools/check_knitr_version.R')"
Rscript -e "knitr::knit('$$(basename $<)', output = '$$(basename $@)')"

## commands : Display available commands.
Expand Down
5 changes: 5 additions & 0 deletions tools/check_knitr_version.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if (require("knitr")) {
if (packageVersion("knitr") < '1.9.19') {
stop("knitr must be version 1.9.20 or higher")
}
} else stop("knitr 1.9.20 or above is needed to build the lessons.")

0 comments on commit a7c7240

Please sign in to comment.