Skip to content

Commit

Permalink
feat(omz): add git-pr-check function to list GitHub pull requests in …
Browse files Browse the repository at this point in the history
…child directories
  • Loading branch information
JakeTRogers committed Jun 28, 2024
1 parent 49fb124 commit 23af3bc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions omz/functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,24 @@ git-tag-semver() {
fi
fi
}

# function to check child directories for pull requests
# usage: git-check-prs [ --help ]
git-pr-check() {
if [[ $1 == "--help" || $1 == "-h" || $1 == "-?" ]]; then
echo "Usage: git-pr-check [ --help ]"
echo -e "Purpose: check child directories for pull requests"
echo "Example 1:"
echo -e " server> git-pr-check\n"
else
for dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
echo $dir
git -C "$dir" fetch origin
cd "$dir"
git remote -v | grep -iq "github" && gh pr list
cd ..
echo
echo
done
fi
}

0 comments on commit 23af3bc

Please sign in to comment.