Advertisement
janek9971

commit-msg

Mar 10th, 2023
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.28 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. INPUT_FILE=$1
  3. START_LINE=`head -n1 $INPUT_FILE`
  4. PATTERN="^#[0-9]+ .*"
  5. if ! [[ "$START_LINE" =~ $PATTERN ]]; then
  6.   echo "Bad commit message, see example: #[numertaska] [komentarz] commit message"
  7.   echo "Enetered commit message '$START_LINE'"
  8.   exit 1
  9. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement