Skip to content

Useful scripts and programs

Starbeamrainbowlabs edited this page Aug 19, 2019 · 13 revisions

Create a new issue if a page doesn't exist

# 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]")
}

Find pages that don't exist

A script that finds pages that haven't been created yet can be found here. It has 2 modes:

  • history - Searches your ~/.bash_history
  • man - Searches the installed man pages
Clone this wiki locally