EthanLin-TWer / frontend-nanodegree-arcade-game

http://linesh.tw/frontend-nanodegree-arcade-game
8 stars 2 forks source link

Infra: Git commit message check #29

Open EthanLin-TWer opened 7 years ago

EthanLin-TWer commented 7 years ago

后两个太难,暂时放弃了。

image

#!/bin/sh

commit_regex="\[Linesh\]\[#\d*\]\s\(Chore\|Feature\|Fix\|Docs\|Style\|Refactor\|Test\):\s[a-z]"
error_msg="Aborting commit, please double check your commit message."

if ! echo "$1" | grep -iqE "$commit_regex" ;
then
        echo "$error_msg" >&2
        exit 1
fi