with_dir: Execute Code in a Temporary Working Directory
Description
This is a verbatim copy of withr::with_dir from of withr's
version 2.4.1.
I often need withr only to import withr::with_dir, which is a
really simple function. So I just hijack withr::with_dir.
Usage
with_dir(new, code)
Arguments
new
The new working directory.
code
Code to execute in the temporary working directory.
Value
The results of the evaluation of the code argument.