version-bump-prompt icon indicating copy to clipboard operation
version-bump-prompt copied to clipboard

Config file for defaults

Open crobinson42 opened this issue 6 years ago • 3 comments

Hi, awesome project!! I'd love to contribute.

I run bump --tag --commit every time one of my repos changes and I was thinking there would be a lot of convenience to have a .bumprc file to set default behavior and such. For me I would put tag=true and commit=true in the .bumprc file and only have to run bump from the project root. Thoughts?

crobinson42 avatar Jun 04 '19 12:06 crobinson42

I love this idea! Would gladly accept a PR to add this functionality. You could use a library like rc or cosmiconfig for this.

JamesMessinger avatar Jun 05 '19 09:06 JamesMessinger

So my first thoughts are that the .bumprc file, if it exists, sets the spreads defaults for the cli. For example, in a project .bumprc file I have these values: tag=true, commit=true, when I run bump --push in the project, it's pulling the defaults from the rc file and the command is actually bump --tag --commit --push.

This brings up the question of the cli flags accepting a parameter to override a .bumprc settings. For example, if I want to run bump --commit false because I don't want a commit to happen at this time but I also don't want to go edit the .bumprc file before I run the command. 🤔

Thoughts?

crobinson42 avatar Jun 05 '19 13:06 crobinson42

Very good point. I think the typical thing that most CLIs do is allow boolean arguments to be prefixed with no-. So you could do bump --no-commit --no-tag

JamesMessinger avatar Jun 05 '19 15:06 JamesMessinger