mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-06 21:50:14 +00:00
18 lines
428 B
Bash
Executable File
18 lines
428 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
REPO=$1
|
|
|
|
if [ -z "$REPO" ]; then
|
|
echo "Usage: $0 <repo> (e.g. ivuorinen/dotfiles)"
|
|
exit 1
|
|
fi
|
|
|
|
LOCATION=$(curl -s "https://api.github.com/repos/${REPO}/releases/latest" \
|
|
| sed -Ene '/^[[:blank:]]+"tarball_url":[[:blank:]]"(https:[^"]+)",/s//\1/p')
|
|
|
|
echo "Downloading and extracting from: $LOCATION"
|
|
|
|
curl --location --silent "$LOCATION" | tar --extract --gzip --file=-
|
|
|
|
# vim: set ts=2 sw=2 ft=sh et:
|