Skip to content

Instantly share code, notes, and snippets.

@erwinlares
Forked from SimonGoring/autobuild.sh
Created November 2, 2021 20:02
Show Gist options
  • Save erwinlares/6a8e5758f9ee2d0e4d7435234e5b6239 to your computer and use it in GitHub Desktop.
Save erwinlares/6a8e5758f9ee2d0e4d7435234e5b6239 to your computer and use it in GitHub Desktop.
Autobuild RMarkdown presentations
#!/bin/bash
### Set initial time of file
LTIME=`stat -c %Z ./$1.Rmd`
while true
do
ATIME=`stat -c %Z ./$1.Rmd`
if [[ "$ATIME" != "$LTIME" ]]
then
Rscript -e "rmarkdown::render('$1')"
LTIME=$ATIME
fi
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment