defaultCacheDir static method

String defaultCacheDir(
  1. Map<String, String> env
)

Resolves the default ~/.ball/cache directory from an environment map. Takes env as a parameter (rather than reading Platform.environment directly) so both the HOME and USERPROFILE fallback branches are unit-testable without spawning a subprocess with a scrubbed environment.

Implementation

static String defaultCacheDir(Map<String, String> env) {
  final home = env['HOME'] ?? env['USERPROFILE'] ?? '.';
  return p.join(home, '.ball', 'cache');
}