Guest User

Untitled

a guest
Feb 15th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. fi
  2. #!/bin/bash
  3.  
  4. {
  5. # BRANCH="feature/AGS-62-agtrader-digital-ad-changes-for-d"
  6. BRANCH=$(git rev-parse --abbrev-ref HEAD 2>&1)
  7. } || {
  8. echo "Is not a git repository..."
  9. exit 1;
  10. }
  11.  
  12. if [[ $BRANCH =~ ^[a-zA-Z]+\/([A-Z]+-[0-9]+)- ]]; then
  13. ISSUE_ID=${BASH_REMATCH[1]}
  14. else
  15. echo "Branch '$BRANCH' has no code in it."
  16. exit 1;
  17. fi
  18.  
  19. MSG="${@:1}"
  20.  
  21. git commit -m "[$ISSUE_ID] $MSG";
Add Comment
Please, Sign In to add comment