Skip to content

Commit

Permalink
Only try building R files if there are some
Browse files Browse the repository at this point in the history
  • Loading branch information
gvwilson committed Jun 23, 2016
1 parent 8667603 commit 08d224a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Expand Down
5 changes: 4 additions & 1 deletion bin/knit_lessons.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 08d224a

Please sign in to comment.