Created
April 4, 2019 02:14
-
-
Save albertogalan/98871372b3184420730ff723e89e86d9 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
# create a new issue if not found (requires hub cli client) | |
# checks brew and cargo for homepage + description | |
function tld { | |
tldr $* 2>/dev/null && return | |
local repo=~/code/tldr # replace with location to tldr repo | |
local info=("${(@f)$(brew info --json=v1 $1 2>/dev/null | jq -r '.[].homepage,.[].desc')}") | |
test $#info -gt 1 || info=("${(@f)$(cargo show $1 2>/dev/null | awk '/^homepage|description/ { $1=""; print }')}") | |
test $#info -gt 1 || return | |
hub -C $repo issue | grep $1 && return | |
hub -C $repo issue create -F <(echo "page request: $1\n\nAdd documentation for [$1]($info[1])\n$info[2]") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment