Last active
January 9, 2021 22:34
-
-
Save iperdomo/a593f90c21308808b91f0167599b81d0 to your computer and use it in GitHub Desktop.
Bash alternative to https://github.com/Rich-Harris/degit
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
#!/usr/bin/env bash | |
# Note: It only supports GitHub, no caching nor fancy error handling | |
set -euo pipefail | |
repo="${1}" | |
directory="${repo/*\//}" | |
mkdir -p "${directory}" | |
curl --location "https://api.github.com/repos/${repo}/tarball" | \ | |
tar --extract --ungzip --strip-components=1 --directory "${directory}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment