Skip to content

Instantly share code, notes, and snippets.

@colstrom
Last active December 9, 2016 18:45
Show Gist options
  • Select an option

  • Save colstrom/18904cd7b8c90ed60dadb1c9acac04b2 to your computer and use it in GitHub Desktop.

Select an option

Save colstrom/18904cd7b8c90ed60dadb1c9acac04b2 to your computer and use it in GitHub Desktop.
gistpkg-avail.fish: list available gistpkgs from user
function gistpkg-avail --argument username
switch (count $argv)
case 0
echo 'usage: gistpkg-avail <username>'
return 100
case '*'
github-api /users/$username/gists | jq -r '.[] | select(.files | keys[] | test("^gistpkg.zpl$")) | [([.owner.login, .id] | join("/")), .description] | @tsv'
end
end
name = gistpkg-avail
author = Chris Olstrom
license = MIT
provides = fish/functions/gistpkg-avail
requires
command/jq
fish/builtin/case
fish/builtin/count
fish/builtin/echo
fish/builtin/end
fish/builtin/function
fish/builtin/return
fish/builtin/switch
fish/functions/github-api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment