From 08d224ae517097404eba6ce981e8f16e9593eedf Mon Sep 17 00:00:00 2001 From: Greg Wilson Date: Thu, 23 Jun 2016 15:43:47 -0400 Subject: [PATCH] Only try building R files if there are some --- Makefile | 2 +- bin/knit_lessons.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 994d66b9..c8011dde 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ HTML_DST = \ ## lesson-rmd: : convert Rmarkdown files to markdown lesson-rmd: $(RMD_SRC) - @bin/knit_lessons.sh + @bin/knit_lessons.sh $(RMD_SRC) ## lesson-check : validate lesson Markdown. lesson-check : diff --git a/bin/knit_lessons.sh b/bin/knit_lessons.sh index ff5443b0..3a2395f3 100755 --- a/bin/knit_lessons.sh +++ b/bin/knit_lessons.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash -if [ -d "_episodes_rmd" ] ; then +# Only try running R to translate files if there are some files present. +# The Makefile passes in the names of files. + +if [ $# -ne 0 ] ; then Rscript -e "source('bin/generate_md_episodes.R')" fi