Last active
February 15, 2017 04:16
-
-
Save paulredmond/9dbae7e6c83b98db3a369e181acea1bc to your computer and use it in GitHub Desktop.
A bash script to publish my Atom text editor plugins. See a working version here https://github.com/paulredmond/atom-larasnippets/blob/master/publish
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
#!/usr/bin/env bash | |
TYPE=${1:-minor} | |
npm run docs | |
# Commit documenation changes if they exist | |
# @see http://stackoverflow.com/a/5143914/599230 | |
if ! git diff-index --quiet HEAD --; then | |
echo "The documentation has changes..." | |
git commit -am"Update documentation" | |
fi | |
npm version $TYPE \ | |
&& git push --tags origin master \ | |
&& VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[", ]//g') \ | |
&& echo "Publishing version v$VERSION" \ | |
&& apm publish --tag "v$VERSION" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment