mirror of
https://github.com/hashicorp/packer.git
synced 2026-10-18 12:12:03 -04:00
When a test has to run in a working directory that is not the current one we're running tests from, this may imply creating a temporary directory, moving files into it, and then running the test from this directory. This can be a bit verbose to write all this code, so we abstract the easy case through the TempWorkdir function, which works similarly to the MakePluginDir function, by creating a temp dir, populating it with the requested files, and returning a function to clean it up if needed.