Created
January 10, 2025 05:30
-
-
Save kmatt/941ec8595cd6a4f65c4f42cbc2181451 to your computer and use it in GitHub Desktop.
Download all Gists using Github CLI
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
# Download all Gists | |
for i in $(gh gist list -L 1000 | cut -f1); do echo "ID: $i"; gh gist view $i > $i; done | |
# Rename each file with a slug of the first line / description | |
for f in *; do mv -v $f $(gawk 'NR==1{gsub(/[^[:alnum:]]/, "-"); gsub(/-+/, "-"); print $0 "_" FILENAME}' $f); done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment