execOptionsFromYaml static method

  1. @visibleForTesting
ExecOptions execOptionsFromYaml(
  1. Map<Object?, Object?> yaml, {
  2. required String scriptName,
})

Implementation

@visibleForTesting
static ExecOptions execOptionsFromYaml(
  Map<Object?, Object?> yaml, {
  required String scriptName,
}) {
  final execPath = 'scripts/$scriptName/exec';

  final concurrency = assertKeyIsA<int?>(
    key: 'concurrency',
    map: yaml,
    path: execPath,
  );

  final failFast = assertKeyIsA<bool?>(
    key: 'failFast',
    map: yaml,
    path: execPath,
  );

  final orderDependents = assertKeyIsA<bool?>(
    key: 'orderDependents',
    map: yaml,
    path: execPath,
  );

  return ExecOptions(
    concurrency: concurrency,
    failFast: failFast,
    orderDependents: orderDependents,
  );
}