fork(15) download
  1. #!/bin/bash
  2. FILE_CONTENT="feat(lang.hook): add polish language"
  3. REGEX="^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)"
  4. if [[ $FILE_CONTENT =~ $REGEX ]]; then
  5. echo "Nice commit!"
  6. else
  7. echo "Bad commit \"$FILE_CONTENT\", check format."
  8. echo $ERROR_MSG
  9. exit 1
  10. fi
Success #stdin #stdout 0s 4220KB
stdin
Standard input is empty
stdout
Nice commit!