-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_kc2tei_stylesheets_dir.sh
executable file
·70 lines (54 loc) · 1.36 KB
/
create_kc2tei_stylesheets_dir.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
69
#!/usr/bin/env sh
SCRIPT=$( readlink -f "$0" )
SCRIPT_PATH=$( dirname "$SCRIPT" )
KCTEI_ZIP="${SCRIPT_PATH}/../kc2tei/kc2tei/target/kc2tei.zip"
KCTEI_ARCHVE_CREATOR="${SCRIPT_PATH}/../kc2tei/kc2tei/create_final_archive.sh"
STYLESHEET_ZIP="${SCRIPT_PATH}/../kctei_stylesheets/kctei_stylesheets.zip"
STYLESHEET_ARCHIVE_CREATOR="${SCRIPT_PATH}/../kctei_stylesheets/create_final_archive.sh"
cd ${SCRIPT_PATH}
echo "Creating kc2tei structure ..."
rm -rf kc2tei/
OUT=$( $KCTEI_ARCHVE_CREATOR 2>&1 )
if [ $? -ne 0 ]; then
echo "$OUT"
exit 1
fi
OUT=$( cp -a "$KCTEI_ZIP" . 2>&1 )
if [ $? -ne 0 ]; then
echo "Error while copying archive!"
echo "$OUT"
echo "Exitting ..."
exit 1
fi
OUT=$( unzip kc2tei.zip 2>&1 )
if [ $? -ne 0 ]; then
echo "Error while unzipping archive!"
echo "$OUT"
echo "Exitting ..."
exit 1
fi
rm kc2tei.zip
rm -rf kc2tei/data/
echo "Creating kctei_stylesheets structure ..."
rm -rf kctei_stylesheets/
OUT=$( $STYLESHEET_ARCHIVE_CREATOR 2>&1 )
if [ $? -ne 0 ]; then
echo "$OUT"
exit 1
fi
OUT=$( cp -a "$STYLESHEET_ZIP" . 2>&1 )
if [ $? -ne 0 ]; then
echo "Error while copying archive!"
echo "$OUT"
echo "Exitting ..."
exit 1
fi
OUT=$( unzip kctei_stylesheets.zip 2>&1 )
if [ $? -ne 0 ]; then
echo "Error while unzipping archive!"
echo "$OUT"
echo "Exitting ..."
exit 1
fi
rm kctei_stylesheets.zip
rm -rf kctei_stylesheets/data/