removeDirectoryAsync static method

Future<void> removeDirectoryAsync(
  1. String path
)

创建文件夹

Implementation

static Future<void> removeDirectoryAsync(String path) async {
  if (!(await existsAsync(path))) {
    return;
  }
  if (await isDirectoryAsync(path)) {
    Logger.info('rmdir $path');
    await Directory(path).delete(recursive: true);
  } else {
    Logger.info('rm $path');
    // 文件默认也删除
    File(path).delete(recursive: true);
  }
}