1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-11-20 01:52:32 +01:00
This commit is contained in:
GilbN 2022-07-10 16:49:24 +00:00
parent 08dd5afb0e
commit 8fe7ca6fe5

17
fetch.sh Normal file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Downloads all docker mod scripts
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