From a4f2b2da549ebceb7d60a29f18cd9381891a77e2 Mon Sep 17 00:00:00 2001 From: GilbN Date: Sun, 10 Jul 2022 18:39:49 +0200 Subject: [PATCH] Add docker mods fetch script --- docker-mods/fetch.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docker-mods/fetch.sh diff --git a/docker-mods/fetch.sh b/docker-mods/fetch.sh new file mode 100644 index 00000000..b545c139 --- /dev/null +++ b/docker-mods/fetch.sh @@ -0,0 +1,16 @@ +#!/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 \ No newline at end of file