Last active
October 7, 2020 03:49
-
-
Save darcyclarke/51bdd744bf27d63e0229833672db7615 to your computer and use it in GitHub Desktop.
npm prepublish check for package@version existence
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
{ | |
"scripts": { | |
"prepublish" : "[[ $(npm view $npm_package_name@$npm_package_version --silent) ]] && echo \"error: $npm_package_name@$npm_package_version exists already!\" && exit 1 || echo \"successful check: $npm_package_name@$npm_package_version does not exist already\"" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment