Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
matanlurey committed Oct 17, 2024
1 parent 6e5f698 commit c54eeec
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/chore/lib/src/command/coverage.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:io' as io;

import 'package:chore/chore.dart';
import 'package:path/path.dart' as p;
import 'package:sdk/sdk.dart';

/// A command that collects and reports code coverage.
Expand Down Expand Up @@ -66,5 +67,15 @@ final class Coverage extends BaseCommand {
io.stderr.writeln('✅ Formatted coverage.');
}
}

// ensure coverage/lcov.info exists
final lcov = io.File(p.join(package.path, 'coverage', 'lcov.info'));
if (!lcov.existsSync()) {
io.exitCode = 1;
io.stderr.writeln('❌ No coverage data found at ${lcov.path}.');
return;
} else {
io.stderr.writeln('✅ Found coverage data at ${lcov.path}.');
}
}
}

0 comments on commit c54eeec

Please sign in to comment.