computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
502 B
25 lines
502 B
2 years ago
|
#!/bin/sh
|
||
|
|
||
|
# Checking a pr using hub
|
||
|
|
||
|
set -e
|
||
|
|
||
|
require() {
|
||
|
if [[ -z $(command -v "$1" 2>/dev/null) ]]; then
|
||
|
echo " 🛑 Please install $1 and try again"
|
||
|
exit 1
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
require jq
|
||
|
require gh
|
||
|
require fzf
|
||
|
|
||
|
prd="$(gh pr list --json 'number,title' | jq -r '.[]| [.number, .title] | @sh' | column -t -s"'" | fzf)"
|
||
|
[ -z "$prd" ] && echo "No PR selected" && exit 0
|
||
|
|
||
|
pr_id="$(echo "$prd" | awk '{print $1}')"
|
||
|
|
||
|
gh pr view "$pr_id" --json "files" | jq -r '.files|map(.path)|.[]'
|
||
|
gh pr checkout "$pr_id"
|