-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.sh
executable file
·50 lines (40 loc) · 1.25 KB
/
setup.sh
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
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# Sets up the data needed to run the integration tests in this directory.
#
# First, the minecraft-assets repo is fetched by doing:
# $ git submodule init
# $ git submodule update
#
# Then each of the versions that are tested are checked out as a separate
# git worktree in `assets-${VERSION}/`.
set -e
SCRIPT_PATH=$(realpath "$0")
TESTS_DIR=$(dirname "${SCRIPT_PATH}")
ASSETS_DIR="${TESTS_DIR}/minecraft-assets"
checkout_assets() {
VERSION=$1
VERSION_DIR="${TESTS_DIR}/assets-${VERSION}"
if [ ! -e "${VERSION_DIR}/.git" ]; then
echo "============ Checking out assets version ${VERSION} ============="
git -C "${ASSETS_DIR}" worktree add "${VERSION_DIR}" "${VERSION}"
else
echo "========= Already checked out assets version ${VERSION} ========="
fi
}
if [ ! -d "${ASSETS_DIR}/.git" ]; then
echo "=============== Initializing submodules ==============="
git submodule init
echo "================= Updating submodules ================="
git submodule update
fi
checkout_assets "1.8"
checkout_assets "1.9"
checkout_assets "1.11"
checkout_assets "1.12"
checkout_assets "1.13"
checkout_assets "1.14"
checkout_assets "1.15"
checkout_assets "1.16.2"
checkout_assets "1.17"
checkout_assets "1.18"