save method

Future save(
  1. Directory projectDirectory
)

saves the pubspec to the projectDirectory

Implementation

Future save(Directory projectDirectory) async {
  final ioSink =
      File(p.join(projectDirectory.path, 'pubspec.yaml')).openWrite();
  try {
    YamlToString().writeYamlString(toJson(), ioSink);
  } finally {
    return ioSink.close();
  }
}