Skip to content

Instantly share code, notes, and snippets.

Andres Monge aemonge

Block or report user

Report or block aemonge

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aemonge / prepare-commit-msg
Last active Jun 3, 2019
Angular Commit Message Conventions git hook, so you got your commit prepared to with the messages they expect ;)
View prepare-commit-msg
firstLine=`head -2 $1 | tail -1`
if [[ $firstLine == \#* ]]; then # Testing that the file starts with a comment, not yet a real commit ;)
echo '<type>(<component>): <subject>' > .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '<body>' >> .prepare-commit-msg-temp
echo '' >> .prepare-commit-msg-temp
echo '# types: feat, fix, docs, style, refactor, test, chore(mantean)' >> .prepare-commit-msg-temp
{ cat .prepare-commit-msg-temp; cat $1; } > .prepare-commit-msg-temp2
cat .prepare-commit-msg-temp2 > $1
You can’t perform that action at this time.