removePackageFromCache static method

  1. @visibleForTesting
Future<bool> removePackageFromCache(
  1. String packageName,
  2. String version
)

Implementation

@visibleForTesting
static Future<bool> removePackageFromCache(
    String packageName, String version) async {
  try {
    final directory = Directory(getPackagePathInCache(packageName, version));
    if (!await directory.exists()) {
      return true;
    }
    await directory.delete();
  } catch (error) {
    return false;
  }
  return true;
}