Created
February 16, 2023 00:56
-
-
Save ygalanter/b67569388e844c5d83bad4f5df9adaa5 to your computer and use it in GitHub Desktop.
Script validating that curren version of a package is not the same as published version
This file contains hidden or 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 | |
exit_status=0 | |
# getting current version of the package | |
VER_NEW=$(node -e "console.log(require('./package.json').version);") | |
# getting version of published package | |
VER_OLD=$(npm view . version) | |
# the package has changed but the working version is the same as main version: failing test | |
if [ "$VER_NEW" = "$VER_OLD" ] | |
then | |
echo "FAILED: Same version as published package" | |
exit_status=1 | |
# working version was bumped: test pass | |
else | |
echo "PASSED: Version bump OK" | |
fi | |
exit ${exit_status} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment