A Bash script to download files of a Gist answered by Gemini model
✓ Published0🌍 Public
VVioletVivirand
Last edited Mar 8, 2024
Created on Mar 8, 2024
This example demonstrates a Bash script that downloads all files from a specified GitHub Gist using its unique ID. It first fetches the Gist’s metadata as JSON via the GitHub API with `curl`, then extracts raw file URLs using `jq`’s `.files[].raw_url` filter. The script iterates over each URL, extracts the filename with `basename`, and downloads the file into a chosen directory using a second `curl` call, printing a confirmation for each download. The rendering approach is purely command-line based, relying on the GitHub REST API and standard Unix text-processing tools.
AI-generated description