createTempDir method

String createTempDir()

Create a new temporary directory within the system cache.

The system cache maintains its own temporary directory that it uses to stage packages into while downloading. It uses this instead of the OS's system temp directory to ensure that it's on the same volume as the pub system cache so that it can move the directory from it.

Implementation

String createTempDir() {
  var temp = ensureDir(tempDir);
  return io.createTempDir(temp, 'dir');
}