We have a winner! (By bending the rules.)
On 10 January 2019 at 16:44, Kyle Baron wrote: | Will this work for you? | | I had to stash the working directory (when R CMD build is run) in an | environment variable via ~/.R/build.Renviron` | | $ cat ~/.R/build.Renviron | OLDWD=${PWD} That is less unconditional that I desired, but it works. | But a Makefile tucked in vignettes directory will run and the two | files will be there in the built package. For me, I couldn't get | OLDPWD so I saved it as OLDWD instead | | $ tree vignettes/ | vignettes/ | ├── Makefile | └── Untitled.Rmd | | $ more vignettes/Makefile | | all: | echo ${OLDWD} > ../inst/old.txt | echo ${PWD} > ../inst/current.txt Then 'current.txt' is as before a temporary directory per R's build conventions, but old.txt does indeed contain the source directory. Close enought :) Thanks very much for passing that creative hack along! Dirk -- http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel