We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cbd61a1 + ea734bc commit 3f8a0e0Copy full SHA for 3f8a0e0
tools/config.R
@@ -574,6 +574,15 @@ if (!interactive()) {
574
args <- commandArgs(TRUE)
575
type <- args[[1]]
576
577
+ # preserve working directory
578
+ owd <- getwd()
579
+ on.exit(setwd(owd), add = TRUE)
580
+
581
+ # switch working directory to the calling scripts's directory as set
582
+ # by the shell, in case the R working directory was set to something else
583
+ basedir <- Sys.getenv("PWD", unset = ".")
584
+ setwd(basedir)
585
586
# report start of execution
587
package <- Sys.getenv("R_PACKAGE_NAME", unset = "<unknown>")
588
fmt <- "** preparing to %s package '%s' ..."
0 commit comments