tunasync-scripts/julia.sh
2020-08-12 18:35:06 +08:00

17 lines
666 B
Bash
Executable File

#!/bin/bash
set -e
BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://mirrors.sjtug.sjtu.edu.cn/julia"}
[[ -d "${TUNASYNC_WORKING_DIR}" ]]
cd "${TUNASYNC_WORKING_DIR}"
OUTPUT_DIR="$PWD/static"
REGISTRY_NAME="General"
REGISTRY_UUID="23338594-aafe-5451-b93e-139f81909106"
REGISTRY_UPSTREAM="https://github.com/JuliaRegistries/General"
REGISTRY="(\"$REGISTRY_NAME\", \"$REGISTRY_UUID\", \"$REGISTRY_UPSTREAM\")"
# For more usage of `mirror_tarball`, please refer to
# https://github.com/johnnychen94/StorageMirrorServer.jl/blob/master/examples/gen_static_full.example.jl
exec julia -e "using StorageMirrorServer; mirror_tarball($REGISTRY, [\"$BASE_URL\"], \"$OUTPUT_DIR\")"