UNPKG

756 Bapplication/x-shView Raw
1snippeturl="https://raw.githubusercontent.com/rollbar/rollbar.js/master/dist/rollbar.snippet.js"
2packageurl="https://raw.githubusercontent.com/rollbar/rollbar.js/master/package.json"
3
4curl --silent $snippeturl > addon/snippet.js
5if $(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
15else
16 echo "Git index is dirty, skipping git commit and npm publish steps"
17fi
18
19echo "Snippet updated!"