Skip to content

Instantly share code, notes, and snippets.

@SimonGoring
Last active November 2, 2021 20:02
Show Gist options
  • Save SimonGoring/6110c8539eeb79d310ddd07597b0b05e to your computer and use it in GitHub Desktop.
Save SimonGoring/6110c8539eeb79d310ddd07597b0b05e 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
@SimonGoring
Copy link
Author

I think that index.html and index.Rmd needs to be changed to $1 . . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment