* docker: pre-download all hub items and data, opt-in hub update/upgrade * docker/bars: don't purge anything before pre-downloading hub * Docker: README update
28 lines
654 B
Bash
Executable file
28 lines
654 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
# shellcheck disable=SC1007
|
|
THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
# shellcheck disable=SC1091
|
|
. "${THIS_DIR}/../.environment.sh"
|
|
|
|
# pre-download everything but don't install anything
|
|
|
|
echo "Pre-downloading Hub content..."
|
|
|
|
types=$("$CSCLI" hub types -o raw)
|
|
|
|
for itemtype in $types; do
|
|
ALL_ITEMS=$("$CSCLI" "$itemtype" list -a -o json | itemtype="$itemtype" yq '.[env(itemtype)][] | .name')
|
|
if [[ -n "${ALL_ITEMS}" ]]; then
|
|
#shellcheck disable=SC2086
|
|
"$CSCLI" "$itemtype" install \
|
|
$ALL_ITEMS \
|
|
--download-only \
|
|
--error
|
|
fi
|
|
done
|
|
|
|
echo " done."
|