Skip to content

Instantly share code, notes, and snippets.

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 troelskn/734505 to your computer and use it in GitHub Desktop.
Save troelskn/734505 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Note the use of env. This is because executables may not be placed in the same place on all systems. Notoriously, bsd (and thus mac osx) differs from linux. However, /usr/bin/env always exists in the same place, and it can tell you where other executables are. Thus, the above is good style for portability.
COMMIT_VERSION=$(git rev-parse --verify HEAD)
# You could also use backticks, but the $() syntax is generally more readable
# Convention is to put variables in uppercase in shell script
curl -k -u user:password \
-d "to=lsolesen&msg=%22Intraface+build+failed%22&title=Intraface+build+failed&uri=https%3A%2F%2Fgithub.com%2Fintraface%2Fintraface.dk%2Fcommit%2F${COMMIT_VERSION}" \
https://api.notifo.com/v1/send_notification > /dev/null
# You can embed a variable in a string, using the ${VAR_NAME} syntax.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment