emptyOrCreate method

Future<void> emptyOrCreate()

Ensure the directory is created and empty.

Implementation

Future<void> emptyOrCreate() async {
  if (await exists()) {
    try {
      await delete(recursive: true);
    } catch (_) {
      // ignore
    }
  }
  await create(recursive: true);
}