Saves this PubSpec to a pubspec.yaml at the given path. The path must be a directory not a file name.
path
void saveToFile(String path) { waitForEx<dynamic>(pubspec.save(Directory(dirname(path)))); }