-
Notifications
You must be signed in to change notification settings - Fork 3
/
update.sh
executable file
·68 lines (59 loc) · 1.15 KB
/
update.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# PPAU Graphics Update Script
USAGE="update.sh [--crush] [--fonts] [--log log_file] <site_address>"
# Handle arguments
CRUSH=""
INSTALLFONTS="N"
LOGGING="--quiet"
ROOT="."
OTHERS=()
# gotta be at least one argument
if [[ $# -eq 0 ]]; then
echo "Usage: $USAGE"
exit
fi
for arg in "$@"
do
case $arg in
-h|--help)
echo "Usage: $USAGE"
exit
;;
--crush)
CRUSH="--crush"
shift
;;
--fonts)
INSTALLFONTS="Y"
shift
;;
--log)
LOGGING="--log $2"
shift
shift
;;
*)
OTHERS+=("$1")
shift
;;
esac
done
ROOT="$OTHERS" # by default, the first?
# gotta do this
cd $(dirname "$0")
# pull and render
git reset --hard --quiet
git pull --quiet
if [ "$INSTALLFONTS" == "Y" ]
then
python3 font-installer.py $LOGGING
fi
python3 clean.py $LOGGING
python3 render.py $LOGGING $CRUSH
python3 create_index.py --site-root $ROOT $LOGGING
cd Logos
if [[ "$ROOT" != "." ]]; then
python3 RenderLogos.py --page-root "$ROOT/Logos" $LOGGING
else
python3 RenderLogos.py --page-root "." $LOGGING
fi