Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set settings in .mversionrc files #15

Closed
timkelty opened this issue Aug 4, 2014 · 16 comments
Closed

Set settings in .mversionrc files #15

timkelty opened this issue Aug 4, 2014 · 16 comments

Comments

@timkelty
Copy link

timkelty commented Aug 4, 2014

Feature request!

I think it would be great if mversion looked at it's current directory and up for any .mversionrc files and allowed you to put settings there.

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

What kind of settings are you thinking of mainly? Something like:

{
  "commitMessage": "Bumps to version %s",
  "tagName": "v%s-src",
  "noPrefix": true,
  "push": "origin master"
}

(if push is being implemented - ref issue #14)

And then you would just do

$ mversion minor

To bump?

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

@mikaelbr exactly!

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

Good idea. This shouldn't alter any of the existing behaviour, though. And if for instance --tag "v%s" is passed, it should take precedence over the rc-file.

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

Yep, agreed.

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

With a place to set options, I could also see wanting an option for something like commandsAfter, where I might put npm publish. Though that could be a dedicated option as well.

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

This is a very good idea I think. I'm a bit hesitant of adding features willy-nilly, but I think this sounds very useful.

I'm almost done implementing the rc-file now, just adding the final tests - and I'll look into adding scripts afterwords.

What is the best naming, you think?
post_scripts/pre_scripts (or with camelCase)
or commandsAfter/commandsBefore.

Any other?

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

I'm ok with either. Just plain old after/before would be ok too, I think.

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

I think the best naming would be preupdate and postupdate to match the naming conventions of https://www.npmjs.org/doc/misc/npm-scripts.html

I initially though of having a set of commands, as in

{
   "postupdate": [ "git push", "npm install" ]
}

But I think this increases the complexity and raises questions of sync or async etc. It's better to have:

{
   "postupdate": "git push && npm install"
}

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

Agreed on both accounts.

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

Will this just look in the dir where you're executing the commands, or it look all the way up the file system (like most rc files)?

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

My thought was, since mversion requires you to be in the dir where package.json, bower.json or where ever is, it's also natural to think that the .mversionrc file would be there, no?

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

Reasonable to assume, I think this is usually just how rc files work.
e.g. .jshintrc: http://www.jshint.com/docs/

This way you could just put your defaults in your home dir if you wanted to.

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

Good thinking. Allowing for more global default settings.

mikaelbr added a commit that referenced this issue Aug 4, 2014
@mikaelbr mikaelbr closed this as completed Aug 4, 2014
@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

Available in version 1.3.0.

@timkelty
Copy link
Author

timkelty commented Aug 4, 2014

Now that's what I call service!

Now I can ditch these silly grunt-bump dependencies and manage things globally.

Thanks!

@mikaelbr
Copy link
Owner

mikaelbr commented Aug 4, 2014

I use this over gulp-bump myself (obviously maybe?).
No worries, by the way. Very happy to help.

Thanks for a great issue and fantastic responses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants