From 8fe7ca6fe56eac4ae7f9882e1af39fbd325acb1e Mon Sep 17 00:00:00 2001 From: GilbN Date: Sun, 10 Jul 2022 16:49:24 +0000 Subject: [PATCH] deploy: ae571bfccd6f5d557e144448e514c516f28a67a1 --- fetch.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fetch.sh diff --git a/fetch.sh b/fetch.sh new file mode 100644 index 00000000..9f137ab3 --- /dev/null +++ b/fetch.sh @@ -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 \ No newline at end of file