-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·63 lines (54 loc) · 2.06 KB
/
install
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
58
59
60
61
62
63
#!/bin/sh
# Usage: $0
# create and populate the 'app' directory to be served
if ! [ -d "KingdomCreator" ]; then
echo 'cloning KingdomCreator randomizer from github (requires internet)'
# original: https://github.com/blakevanlan/KingdomCreator.git
git clone https://github.com/polijan/KingdomCreator.git || exit
# checkout the right version:
cd KingdomCreator || exit
git checkout 1b21d6d485e6f40dd269a98eb2ce529392d93ff4
# git checkout "$(git rev-list -n 1 --before="2023-12-26" master)" || exit
cd ..
fi
if ! [ -d 'app' ]; then
echo 'creating directory "app" and linking files into it'
mkdir --verbose app
( cd app || exit
for i in ../KingdomCreator/docs/img \
../KingdomCreator/docs/rules \
../KingdomCreator/docs/*.css \
../KingdomCreator/docs/*.js \
../KingdomIndex/KingdomCreator_html/*.html \
../KingdomIndex/*.html \
../KingdomIndex/cgi-bin \
../KingdomIndex/img_index \
../KingdomIndex/res \
../preview.jpg \
../games ; do
ln --verbose -s "$i" # (invoking ln with no destination is a GNU-ism)
done
)
fi
cd app || exit
if ! [ -f board.html ]; then
echo 'creating an initial board'
../KingdomIndex/mkboard.sh -2 >board.html
# another solution would be to just create a dummy board:
# echo '<html><body><h1>No board has been generated yet.</h1></body></html>' \
# >> board.html
fi
if ! [ -f game-index.html ]; then
echo 'creating game content pages'
../KingdomIndex/mkgames.sh
fi
for i in games/*; do
GAME="game-unofficial-$(basename "$i").html"
if [ -f "$i/mkgame.sh" ] && ! [ -e "$GAME" ]; then
"$i/mkgame.sh" > "$GAME"
fi
done
if ! [ -f start.html ]; then
echo 'creating the start.html starting page'
../KingdomIndex/mkstart.sh > start.html
fi