resolveUserPath method

String resolveUserPath(
  1. String userRoot
)

Resolves userPath against userRoot (null → the default <userRoot>/.fah/memory; ~/x → <userRoot>/x).

Implementation

String resolveUserPath(String userRoot) {
  final path = userPath;
  if (path == null || path.isEmpty) return '$userRoot/.fah/memory';
  if (path.startsWith('~/')) return '$userRoot/${path.substring(2)}';
  if (path.startsWith('/')) return path;
  final stripped = path.startsWith('./') ? path.substring(2) : path;
  return '$userRoot/$stripped';
}