delete method

  1. @override
Future<void> delete(
  1. String path
)
override

Deletes the file or directory path.

Implementation

@override
Future<void> delete(String path) async {
  final p = normalizeRepoPath(path);
  final removed = _files.remove(p) != null;
  if (!removed) {
    // Delete a "directory": drop everything under it.
    final under = _files.keys.where((f) => f.startsWith('$p/')).toList();
    if (under.isEmpty) throw RepoException('Path not found: $path');
    for (final f in under) {
      _files.remove(f);
    }
  }
}