fail method

void fail(
  1. String stage,
  2. String subject,
  3. String logName,
  4. String reason,
)

A step that is red without running anything; the reason is its log.

Implementation

void fail(String stage, String subject, String logName, String reason) {
  final logPath = p.join(runDir, logName);
  File(logPath)
    ..parent.createSync(recursive: true)
    ..writeAsStringSync('$reason\n');
  _record(stage, subject, logPath, false, reason);
  final label = subject == stage ? '[$stage]' : '[$stage] $subject';
  console.writeln('$label RED $reason -> ${relative(logPath)}');
}