Last active
December 9, 2016 18:45
-
-
Save colstrom/18904cd7b8c90ed60dadb1c9acac04b2 to your computer and use it in GitHub Desktop.
gistpkg-avail.fish: list available gistpkgs from user
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 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 |
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
| 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