Skip to content

Instantly share code, notes, and snippets.

@afomera
Created July 15, 2022 19:41
Show Gist options
  • Save afomera/44e2fd16143a25de5e6966e0180b0fda to your computer and use it in GitHub Desktop.
Save afomera/44e2fd16143a25de5e6966e0180b0fda to your computer and use it in GitHub Desktop.
gitwork
function gitwork() {
local author="${1:-@me}"
local daysAgo="${2:-7}"
gh pr list -A $author -L 50 -S "merged:>=$(date -v-$daysAgo\d +%Y-%m-%d)" --json title,url,mergedAt > prs.json && ruby -e 'require "json"; prs = JSON.parse(File.read("prs.json")); prs.map { |pr| puts "<a href=\"#{pr["url"]}\">#{pr["title"]}</a><br>" }' | textutil -stdin -format html -convert rtf -stdout | pbcopy && rm prs.json
echo "Copied list of PRs to clipboard"
}
@colinloretz
Copy link

TIL you can write functions in .zshrc. Fun script!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment