1 | snippeturl="https://raw.githubusercontent.com/rollbar/rollbar.js/master/dist/rollbar.snippet.js"
|
2 | packageurl="https://raw.githubusercontent.com/rollbar/rollbar.js/master/package.json"
|
3 |
|
4 | curl --silent $snippeturl > addon/snippet.js
|
5 | if $(git diff-index --quiet --cached HEAD); then
|
6 | echo "Committing changes ..."
|
7 | version=$(curl --silent $packageurl | grep 'version": "' | head -n 1 | cut -d '"' -f 4)
|
8 | git add addon/snippet.js
|
9 | git commit -m "update rollbar snippet to version $version"
|
10 | echo "Publishing changes ..."
|
11 | npm version patch -m "update rollbar snippet to version $version"
|
12 | git push origin master
|
13 | git push origin --tags
|
14 | npm publish
|
15 | else
|
16 | echo "Git index is dirty, skipping git commit and npm publish steps"
|
17 | fi
|
18 |
|
19 | echo "Snippet updated!"
|