make sure that checkpoint version is 0.4.0 or higher
authorFrancois Michonneau <francois.michonneau@gmail.com>
Thu, 4 May 2017 15:58:52 +0000 (11:58 -0400)
committerFrancois Michonneau <francois.michonneau@gmail.com>
Thu, 4 May 2017 16:03:02 +0000 (12:03 -0400)
bin/generate_md_episodes.R

index 5975d957aa379d3ad2cdfb836a483c28493e2fdb..f2a40ba4a7285db9ee2b001ed1a56aabd973a9d8 100644 (file)
@@ -6,12 +6,12 @@ generate_md_episodes <- function() {
     if (!require("stringr"))
         stop("The package stringr is required for generating the lessons.")
 
-    if (require("checkpoint")) {
+    if (require("checkpoint") && packageVersion("checkpoint") >=  '0.4.0') {
         required_pkgs <-
              checkpoint:::scanForPackages(project = "_episodes_rmd",
                                           verbose=FALSE, use.knitr = TRUE)$pkgs
     } else {
-        stop("The checkpoint package is required to build the lessons.")
+        stop("The checkpoint package (>= 0.4.0) is required to build the lessons.")
     }
 
     missing_pkgs <- required_pkgs[!(required_pkgs %in% rownames(installed.packages()))]