Last active
October 26, 2017 18:43
-
-
Save bryceosterhaus/6109103e9725804f665cde6ab227783d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Submit pull-request | |
submit() { | |
jira-ticket "$2" | submit-with-title "$1" "$2" | |
} | |
submit-with-title() { | |
pipeVal=$(< /dev/stdin); | |
branch=$(get_branch) | |
if [ "$2" ]; then | |
branch="$2" | |
fi | |
if [ "$1" ]; then | |
gh pr --submit "$1" --title "$pipeVal" --description 'Jira Issue: '"[$branch](https://issues.liferay.com/browse/$branch)"''; | |
else | |
echo -e "Please enter correct format $fg_bold[red]submit <USER> <BRANCH>$reset_color" | |
fi | |
} | |
submit-no-title() { | |
if [ "$1 && $2" ]; then | |
gh pr --submit "$1" --branch "$2" --description 'Jira Issue: '"[$(get_branch)](https://issues.liferay.com/browse/$(get_branch))"'' | |
else | |
echo -e "Please enter correct format $fg_bold[red]submit <USER> <BRANCH>$reset_color" | |
fi | |
} | |
get_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment