f3ath / pubspec-version

A CLI tool to get/set/bump the `version` key in pubspec.yaml.
https://pub.dartlang.org/packages/pubspec_version
MIT License
26 stars 3 forks source link

Retain pubspec.yml contents #17

Open Agraphie opened 5 years ago

Agraphie commented 5 years ago

Hi there,

thanks for your awesome package! Is there a possibility to retain comments, linebreaks etc. when bumping the version? After bumping the version my pubspec file is very condensed and all comments and linebreaks are deleted.

f3ath commented 5 years ago

This package uses pubspec for pubspec manipulations including encoding/decoding YAML. You'd need to open a feature request (or better a pull request) to that project. Once the "keep original formatting" feature is supported by the pubspec, I'd be happy to use it here.

Agraphie commented 5 years ago

Hm I played around with it and I updated the updateVersion method to only touch the version in the yaml file. I can open a merge request for that and you can look at it? Seems natural that for changing the version only the version is actually touched.