sourceCacheDirectory method
Compute a cache subdirectory for a given repository and revision.
Implementation
Directory sourceCacheDirectory({required String key}) {
// Sanitize the key for use as a directory name.
final sanitized = key.replaceAll(RegExp(r'[/\\:]'), '_');
return Directory('${sourceCacheRoot.path}/$sanitized');
}