mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 12:15:29 +00:00
feat: add Dotbot
This commit is contained in:
18
functions/ghpr.sh
Executable file
18
functions/ghpr.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
# Search and preview GitHub pull requests
|
||||
|
||||
ghpr() {
|
||||
# Force GitHub CLI to use colors
|
||||
export GH_FORCE_TTY=100%
|
||||
|
||||
# List pull requests and pipe to fzf for selection
|
||||
selected_pr=$(gh pr list | fzf --ansi --preview 'GH_FORCE_TTY=100% gh pr view {1}' --preview-window down --header-lines 3)
|
||||
|
||||
# Check if a PR was selected
|
||||
if [ -n "$selected_pr" ]; then
|
||||
# Extract the PR number and checkout
|
||||
pr_number=$(echo "$selected_pr" | awk '{print $1}')
|
||||
gh pr checkout "$pr_number"
|
||||
else
|
||||
echo "No pull request selected."
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user