feat: add Dotbot

This commit is contained in:
Stefan Imhoff
2024-08-09 11:57:28 +02:00
parent a41290c297
commit 0437240919
248 changed files with 1205 additions and 44 deletions

18
functions/ghpr.sh Executable file
View 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
}