1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-08-18 07:59:37 +02:00
theme.park/docker-mods/fetch.sh

16 lines
474 B
Bash
Raw Normal View History

2022-07-10 18:39:49 +02:00
#!/usr/bin/env bash
MODS=$(curl https://develop.theme-park.dev/themes.json | jq -r '.["docker-mods"]')
if [[ "$0" == "bash" ]]; then
DIR="/tmp/theme-park-mods"
else
DIR="$0"
fi
mkdir -p "$DIR"
printf "\nSaving mods into $DIR\n\n"
jq -r 'to_entries | map(.key + "|" + (.value | tostring)) | .[]' <<< "$MODS" | \
while IFS='|' read key value; do
curl "$value" --create-dirs --output "$DIR/$key" --silent
echo "Fetched $key script"
done
sudo chmod go+rx $DIR