Skip to content

Instantly share code, notes, and snippets.

@curtisalexander
Last active November 26, 2017 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curtisalexander/fe66baeb4d37842ddae5d78c78370b92 to your computer and use it in GitHub Desktop.
Save curtisalexander/fe66baeb4d37842ddae5d78c78370b92 to your computer and use it in GitHub Desktop.
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