Created
December 4, 2013 20:08
-
-
Save lawrencejones/7794597 to your computer and use it in GitHub Desktop.
Pre-commit Hook to prevent bad commits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
crrtBranch = (/(?<=\*\s).*/.match `git branch`) | |
user = `echo $USER`.gsub "\n", "" | |
if not ['lawrencejones', 'alanvey'].include? user | |
if crrtBranch.to_s != 'F_CodeGen' | |
puts 'Wrong branch!' | |
exit 1 | |
end | |
end | |
if not system 'make' | |
puts 'Compilation failed.' | |
exit 1 | |
end | |
if not system 'coffee ./src/wacc.coffee' | |
puts 'Wacc module failed.' | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment