If set to an extant directory, it will create a file in that directory with the name following the usual pattern (package, version, platform if binary).
If the dest_path does not already exist or is not a directory, it will create a file with the name dest_path, containing the result.
As far as I can tell, this behaviour is not documented anywhere. Either way, the return string is a path as if it were scenario 1, which is not correct if scenario 2 is in effect.
To reproduce, run the following from the package source directory:
library(pkgbuild)
build(dest_path = "../dest1") # Create a file named "dest1" in the parent directory, with the contents of the tar.gz/zip/tgz, and return a nonexistent path.
dir.create("../dest2")
build(dest_path = "../dest2") # Create a file in ../dest2/, named according to convention, and return a path to it.
Setting
dest_path
can produce two behaviours:dest_path
does not already exist or is not a directory, it will create a file with the namedest_path
, containing the result.As far as I can tell, this behaviour is not documented anywhere. Either way, the return string is a path as if it were scenario 1, which is not correct if scenario 2 is in effect.
To reproduce, run the following from the package source directory: