Created
December 12, 2017 04:58
-
-
Save maximgatilin/0951d3355097166545757b9b16a5caf7 to your computer and use it in GitHub Desktop.
This file contains 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 | |
message_file = ARGV[0] | |
message = File.read(message_file) | |
second_file = ARGV[1] | |
branchname = `git branch --no-color 2> /dev/null`[/^\* (.+)/, 1].to_s.downcase | |
$regex = /#{branchname}/ | |
if !$regex.match(message.downcase) | |
puts branchname | |
puts "[POLICY] Your message is not formatted correctly" | |
exit 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment