-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathgit-pr
More file actions
executable file
·29 lines (28 loc) · 577 Bytes
/
git-pr
File metadata and controls
executable file
·29 lines (28 loc) · 577 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# A convenient way to interact with GitHub pull requests using the `gh` CLI tool.
# > More information: <https://cli.github.com/manual/gh_pr>.
#
# - List all open PRs:
#
# `git-pr`
#
# - Check out the corresponding PR:
#
# `git-pr {{pr_id}}`
#
# - Pass down any other argument(s) to the original `gh pr` command:
#
# `git-pr {{arg1}} {{arg2}}`
#
# ---
# Author: Nick Plekhanov, https://plekhanov.me
# License: MIT
# https://github.com/nicksp/dotfiles
if [ -z "$1" ]; then
gh pr list
elif [[ "$1" =~ ^[0-9]+$ ]]; then
gh pr checkout "$1"
else
gh pr "$@"
fi