Skip to content

Instantly share code, notes, and snippets.

@d1egoaz d1egoaz/pre-push
Created Dec 10, 2015

Embed
What would you like to do?
Scala pre-push git hook that compiles project before pushing it to git server
#!/bin/sh
echo ">> Executing sbt compile before pushing to Git server"
sbt compile
compiles=$?
echo ">> Compiles?"
if [ $compiles -eq 0 ]
then
echo owly
owly="
___
(o,o)
{\`\"\'}
-\"-\"-
YES!
"
echo "$owly"
else
echo "
No! (╯°□°)╯︵ ┻━┻)
"
fi
if [ $compiles -eq 0 ]
then
echo ">> Proceeding with push."
exit 0
else
echo ">> Can't push to Git server due to 'sbt compile' wasn't successful."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.