question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi,

Is it possible to trigger pre/post-bumpversion scripts ?

Let me explain:

For a javascript module, you want to build a dist version of your module, so you need to run babel or somethings like that. It would be great if we could just run these sorts of command after or before bumpversion.

Thank you

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
diegoquintanavcommented, Jun 2, 2019

I second this request. In my case, I would like to git add an updated CHANGELOG.md that I generate with https://github.com/vaab/gitchangelog, besides bumpversion:file and .bumbversion.cfg.

The nice way would be through hooks, but without them I’m forced to do something like this

#!/bin/sh

# fetch new version using bumpversion
CURRENT_VERSION=$(bumpversion --dry-run --allow-dirty --list patch | grep '^current_version' | sed -r s,"^.*=",,)
NEW_VERSION=$(bumpversion --dry-run --allow-dirty --list patch | grep '^new_version' | sed -r s,"^.*=",,)

# generate changelog
# see https://github.com/vaab/gitchangelog/issues/94
gitchangelog | sed -r "s/%%unreleased_version%%/${NEW_VERSION}/g" > CHANGELOG.md

# generate new revisions
bumpversion --dry-run --allow-dirty --verbose --no-commit patch

# stage changes
git add CHANGELOG.md VERSION .bumpversion.cfg

# commit message
# here, `new:` `dev:` and `!minor` are `gitchangelog` syntax
git commit -m "new: dev: bump version ${CURRENT_VERSION} to ${NEW_VERSION} !minor" 

# git tag new revision
git tag -a "v${NEW_VERSION}" -m "bump version v${NEW_VERSION} from v${CURRENT_VERSION}"

So, although this works, here I’m using bumpversion only as a revision parser. I like to think that bumpversion has more potential. I don’t see how this predates a Makefile.

1reaction
perituscommented, Jul 26, 2016

@jdeniau Sorry, not going to happen. Bumpversion won’t be your new Makefile 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

hooks - Amazon.com
15 Pcs Black Wall Mounted Coat Hooks, Hanger Hook with 30 Pieces Screws for Hanging Hat, Towel, Key, Robe, Coats, Scarf, Bag, Cap,...
Read more >
Hooks - Storage & Organization - The Home Depot
Get free shipping on qualified Hooks products or Buy Online Pick Up in Store today in the Storage & Organization Department.
Read more >
Hooks in Hardware - Walmart.com
Shop for Hooks in Hardware. Buy products such as Command Medium Designer Hooks, White, 2 Wall Hooks, Damage Free Hanging of Christmas Dcor...
Read more >
Introducing Hooks - React
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class. ... This...
Read more >
Wall Hooks & Hook Racks - Target
Shop Target for Wall Hooks & Hook Racks you will love at great low prices. Free shipping on orders of $35+ or same-day...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found