Skip to content

Instantly share code, notes, and snippets.

@paulredmond
Last active February 15, 2017 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulredmond/9dbae7e6c83b98db3a369e181acea1bc to your computer and use it in GitHub Desktop.
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
#!/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