File size: 892 Bytes
b110593
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash

##
# LOADS ALL DOCKER COMPOSE DEPS
##

##
# Check if JQ is available
##
if which jq >/dev/null; then
    echo "jq is installed..."
else
    echo "jq is not installed, install it first."
    exit 1
fi

##
# Check if JQ is available
##
if which basename >/dev/null; then
    echo "basename is installed..."
else
    echo "basename is not installed, install it first."
    exit 1
fi

##
# Download the files via the Github API
##
for singleFile in $(curl -s https://api.github.com/repos/weaviate/weaviate/contents/docker-compose/runtime?ref=master | jq -r '.[] | @base64'); do
    _jq() {
        echo "${singleFile}" | base64 --decode | jq -r "${1}"
    }
    URL_RAW=$(_jq '.url') 
    URL_NOPRO=${URL_RAW:7}
    URL_REL=${URL_NOPRO#*/}
    FILENAME=$(basename "/${URL_REL%%\?*}")
    curl "$(_jq '.download_url')" --output "$FILENAME"
done