sql-fun 0.1.0

SQL query/statement execution code generator
Documentation
#!/usr/bin/env bash
set -euo pipefail

msg_file="$1"
msg="$(head -n 1 "$msg_file")"

if [[ "$msg" =~ ^Merge\  ]]; then
  exit 0
fi

# type(scope)!: subject
re='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\([^)]+\))?(!)?: .+'

if [[ ! "$msg" =~ $re ]]; then
  echo "ERROR: commit message is not Conventional Commits."
  echo "  got:  $msg"
  echo "  want: type(scope)!: subject"
  exit 1
fi