[R-pkg-devel] About a need for hooks from R CMD ... commands, and a question

Iñaki Ucar iuc@r @ending from fedor@project@org
Thu Jan 10 22:33:29 CET 2019


On Thu, 10 Jan 2019 at 21:55, Dirk Eddelbuettel <edd using debian.org> wrote:
>
>
> On 9 January 2019 at 17:57, Iñaki Ucar wrote:
> | Did you check Sys.getenv("OLDPWD")? I checked with a knitr vignette
> | and the correct path was there.
>
> Code:
>
> [...]
>
>   <<preliminaries,echo=FALSE,results=hide>>=
>   prettyVersion <- packageVersion("someNameHere")
>   prettyDate <- format(Sys.Date(), "%B %e, %Y")
>   user <- Sys.getenv("USER")
>   dir <- getwd()
>   olddir <- Sys.getenv("OLDPWD")
>   @
>
>   [...]
>
>   \date{Built on \Sexpr{prettyDate} using version \Sexpr{prettyVersion}}
>
>   \maketitle
>
>   Built by '\Sexpr{user}' in directory '\Sexpr{dir}' coming from directory
>   '\Sexpr{olddir}'.
>
> Comes up with an empty / unset olddir when I do
>
>   R CMD build someNameHere; R CMD INSTALL someNameHere_1.2.3.tar.gz

This is quite interesting. Because if you run

R CMD build someNameHere/; R CMD INSTALL someNameHere_1.2.3.tar.gz

(note the "/" after the package name) then the olddir is there.

Iñaki



More information about the R-package-devel mailing list