Giter Club home page Giter Club logo

Comments (5)

mikaelbr avatar mikaelbr commented on July 21, 2024

Hi and thanks for posting an issue!

I'm fairly sure npm version doesn't push to the remote, as I've tried to mimic the usage of it. You can see the implementation here: https://github.com/npm/npm/blob/master/lib/version.js, but maybe you are thinking of grunt-bump or gulp-bump?

I have been considering adding support for pushing as well. Originally my philosophy was to not diverge too much away from npm version, but i've already done so, really.

Often while using mversion I catch myself doing:

$ mversion patch -m
$ git push && git push --tags

So doing something like

$ mversion patch -m -p

instead might be a good idea. It would have to be optional though, and not enabled by default. Also, should have that default remote is origin and branch is current branch. But allowing to override with something like

$ mversion patch -m -p upstream featureBranch

What do you think?

from mversion.

normanrz avatar normanrz commented on July 21, 2024

Sorry, I was confused. Of course it is npm version and it doesn't do remote pushes. Not sure what I was thinking.
Anyways, I totally agree and think that mversion patch -m -p is a fantastic idea!

from mversion.

mikaelbr avatar mikaelbr commented on July 21, 2024

Instead of having this as a part of the CLI, I found that it is much cleaner to use post- and preupdate hooks in a .mversionrc file.

Just create this file in your root:

.mversionrc

{
  "scripts": {
    "postupdate": "git push && git push --tags"
  }
}

This will push after the version has been bumped.

from mversion.

normanrz avatar normanrz commented on July 21, 2024

Nice solution. This rocks!
Extra props for letting me put that .mversionrc in my home dir.

from mversion.

mikaelbr avatar mikaelbr commented on July 21, 2024

All credit to @timkelty for the idea!

from mversion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.