-
Notifications
You must be signed in to change notification settings - Fork 3
/
install-data
executable file
·57 lines (50 loc) · 1.15 KB
/
install-data
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
51
52
53
54
55
56
57
#!/bin/sh
#
# This script checks out and prepares the full version Kobo Redux data files.
# (Of course, this will not work without access to the private repository.)
#
. ./BUILDDEFS
if [ $# -eq 2 ]; then
TAG="$1"
DATADIR="$2"
else
echo "Usage: install-data <tag> <data-directory>"
exit 1
fi
if [ -d "${WORKDIR}/${DATADIR}" ]; then
# TODO: Check if it's the right version. If not, overwrite!
echo "Data directory ${DATADIR} already exists!"
exit 0
fi
set -ex
render=false
# Clone or update repository as needed
if [ ! -d "${DLDIR}" ]; then
mkdir -p "${DLDIR}"
fi
cd ${DLDIR}
if [ ! -d "koboreduxassets" ]; then
git clone [email protected]:olofson/koboreduxassets.git
cd koboreduxassets
git checkout ${TAG}
render=true
else
cd koboreduxassets
if ! git checkout ${TAG} ; then
git checkout master
git pull
git checkout ${TAG}
render=true
fi
git clean -d -x -f
fi
# Render the TIPE sprites
cd src
eel render-sprites
cd ..
# Copy the checked out and rendered data to the destination directory
if [ ! -d "${WORKDIR}" ]; then
mkdir "${WORKDIR}"
fi
cp -r "${DLDIR}/koboreduxassets/data" "${WORKDIR}/${DATADIR}"
echo ${TAG} > "${WORKDIR}/${DATADIR}/DATAVERSION"