save method
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();
}
}