Commit 682e775c authored by David Mawdsley's avatar David Mawdsley
Browse files

Implement using @naupaka 's suggestions

parent e7b99dad
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@ generate_md_episodes <- function() {
    }, src_rmd, dest_md)
    
    # Read the generated md files and add comments advising not to edit them
    sapply(dest_md, function(y) {
      con = file(y)
    vapply(dest_md, function(y) {
      con <- file(y)
      mdfile <- readLines(con)
      if (mdfile[1] != "---")
        stop("Input file does not have a valid header")
@@ -43,8 +43,10 @@ generate_md_episodes <- function() {
      mdfile <- append(mdfile, paste("# Instead, please edit", 
                                     basename(y), "in _episodes_rmd/"), after = 2)
      writeLines(mdfile, con)
    })    

      close(con)
      return(paste("Warning added to YAML header of", y))
    },
    character(1))
}

generate_md_episodes()