Created
July 15, 2022 19:41
-
-
Save afomera/44e2fd16143a25de5e6966e0180b0fda to your computer and use it in GitHub Desktop.
gitwork
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TIL you can write functions in .zshrc. Fun script!