pubspec_yaml_2 4.0.0+1 copy "pubspec_yaml_2: ^4.0.0+1" to clipboard
pubspec_yaml_2: ^4.0.0+1 copied to clipboard

Dart library to access and manipulate content of pubspec.yaml files

example/main.dart

import 'dart:io';

import 'package:pubspec_yaml_2/pubspec_yaml_2.dart';

// ignore_for_file: avoid_print

void main() {
  final pubspecYaml = File('pubspec.yaml').readAsStringSync().toPubspecYaml();

  final productionOverrides = pubspecYaml.dependencyOverrides.where(
    (override) => pubspecYaml.dependencies.any(
      (productionDependency) =>
          productionDependency.package() == override.package(),
    ),
  );

  if (productionOverrides.isEmpty) {
    print('SUCCESS: No overrides of production dependencies detected');
  } else {
    print('WARNING: Overrides of production dependencies detected:');
    productionOverrides.forEach(print);
  }
}
0
likes
150
points
153
downloads

Publisher

unverified uploader

Weekly Downloads

Dart library to access and manipulate content of pubspec.yaml files

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, functional_data, json2yaml, meta, sum_types, yaml

More

Packages that depend on pubspec_yaml_2