ghco: default to listing own PRs

This commit is contained in:
Rob Watson 2021-08-13 10:07:28 +02:00
parent 1d4b531daa
commit 82385f343f
1 changed files with 10 additions and 1 deletions

View File

@ -5,7 +5,16 @@ set -e
export GH_NO_UPDATE_NOTIFIER=1 export GH_NO_UPDATE_NOTIFIER=1
prid=$(gh pr list --limit 100 | fzf | awk '{print $1}') if [ "$1" = '-a' ]; then
cmd='gh pr list --limit 100'
elif [ -z "$GITHUB_USERNAME" ]; then
echo 'set $GITHUB_USERNAME first'
exit 1
else
cmd="gh pr list --author $GITHUB_USERNAME"
fi
prid=$(eval "$cmd" | fzf | awk '{print $1}')
if [ -z $prid ]; then if [ -z $prid ]; then
exit 0 exit 0
fi fi