Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Windows batch file to accompany _watch-render-site or _watch-render-rmd in lieu of a *nix shebang
@echo off
cls
C:
PATH C:\Program Files\R\R~\bin;%PATH%
:: pushd required in the event that the _watch-render-site.R or
:: _watch-render-rmd.R script is on a network drive
@pushd %~dp0
:: reads .Renviron as it sets the environment variable RSTUDIO_PANDOC
:: which is the PATH to pandoc
cmd /c Rscript --no-site-file --no-init-file --no-restore _watch-render.R --patt=".+\.Rmd"
@popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment