Last active
September 17, 2018 17:28
-
-
Save mjlescano/442c3fd884a6adb3584beef97df28515 to your computer and use it in GitHub Desktop.
Shell command to publish an npm package only if its needed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CURRENT_VERSION=$(npm show $(node -pe 'require("./package.json").name') version) | |
NEXT_VERSION=$(node -pe 'require("./package.json").version') | |
[ "$CURRENT_VERSION" != "$NEXT_VERSION" ] && npm publish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment