Skip to content

Instantly share code, notes, and snippets.

@tszumowski
Created March 18, 2019 10:31
Show Gist options
  • Save tszumowski/71d06390cf001a8c540bc7b6d5935281 to your computer and use it in GitHub Desktop.
Save tszumowski/71d06390cf001a8c540bc7b6d5935281 to your computer and use it in GitHub Desktop.
dadjoke bash profile
dadjoke () {
echo $(curl -s https://icanhazdadjoke.com/)
}
pr () {
# No args: defaults to default reviewers, opens file for edit with template and dad joke
# 1 arg: Argument is string of the reviewers to place
dj=$(dadjoke)
if [ "$#" == "0" ]; then
hub pull-request -b <OWNER>:<BRANCH> --reviewer=alice,bob --assign=alice,bob --browse -F <(echo -e "<TITLE>\n\n# What\n* \n\n# Why\n* \n\n# Random Dad Joke\n$(curl -s https://icanhazdadjoke.com/)") --edit
elif [ "$#" == "1" ]; then
hub pull-request -b <OWNER>:<BRANCH> --reviewer=$1 --assign=$1 --browse -F <(echo -e "<TITLE>\n\n# What\n* \n\n# Why\n* \n\n# Random Dad Joke\n$(curl -s https://icanhazdadjoke.com/)") --edit
else
echo "Invalid call"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment