2

Every time I bump the version of my package, I want to write that version in a file for building purposes.

I made a hook on postversion so I can execute my write-version script every time the version is pumped (through npm version).

package.json

"scripts": {
  "postversion": "node write-version && git push && git push --tags"
}

This works, but I would like to get hide the following output it generates:

CLI

> npm version patch

> [email protected] postversion C:\git\my-package-name
> node write-version && git push && git push --tags

Is there a way to do this?

2
  • Try including the silent flag, (either --silent or the shorthand -s ) in your script to omit the unwanted output. More info can be found in this post Commented Dec 23, 2016 at 11:33
  • Thanks. I was hoping I could only silence those two output lines automatically. But I guess this will do for now. Thanks for your input @RobC, much appreciated! Commented Jan 2, 2017 at 10:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.