Last active
June 23, 2017 13:45
-
-
Save turboBasic/0177a75749cdb36553e3b1cd3a26798a to your computer and use it in GitHub Desktop.
Get links to gists, CMD.EXE version. Get links to gists of current github user. Dependencies: see comments
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
REM Get links to all gists of current github user | |
REM | |
REM 2017 Andriy Melnyk https://github.com/TurboBasic | |
REM | |
REM Dependencies: Windows 7+, cmd.exe, curl, jq, environment variable | |
REM curl: If unsure - use curl from Git for Windows - it works fine. | |
REM jq: JSON command-line parser. Packages from chocolatey.org and scoop.sh are of excellent quality | |
REM %githubUser%: default GitHub account to fetch gists from. If not set, fetches 300 random public gists | |
REM Some useful jq filters, insert them before closing square bracket: | |
REM |select(.filename |startswith(\"box\")) | |
REM |select(.filename |contains("boxstarter.ps1")) | |
REM |select(.filename |test("boxstarter\\.ps1"; "i")) | |
SETLOCAL | |
if defined githubUser ( | |
set __api=https://api.github.com/users/%githubUser%/gists | |
) else ( | |
set __api=https://api.github.com/gists | |
) | |
curl %__api% | jq "[ .[] |.description as $d |.files |{gist_description: $d} + to_entries[].value ]" | |
ENDLOCAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment