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 full = _resolve(path);
  final type = FileSystemEntity.typeSync(full, followLinks: false);
  if (type == FileSystemEntityType.notFound) {
    throw RepoException('Path not found: $path');
  }
  if (type == FileSystemEntityType.directory) {
    Directory(full).deleteSync(recursive: true);
  } else {
    File(full).deleteSync();
  }
}