-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-zip.sh
executable file
·44 lines (38 loc) · 999 Bytes
/
make-zip.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
#!/bin/bash
# Create a zip from the directories with the database
# templates and preset.xml for direct upload in the
# database activity. Traverse the current directories
# and check for an preset.xml file. If this is present,
# then assume that we have a directory with templates,
# therefore zip the relevant files and place the zip archive
# in the root directory.
#
# Usage: bash make-zip.sh
# Result: a <directory>.zip in the root directory for
# every preset.
directories=$(ls -p | grep -e /$)
for dir in $directories
do
if [ ! -e ${dir}preset.xml ]; then
continue
fi
zipfile="${dir:0:-1}.zip"
if [ -e "$zipfile" ]; then
rm $zipfile
fi
cd $dir
zip $zipfile \
addtemplate.html \
jstemplate.js \
listtemplateheader.html \
preset.xml \
rsstitletemplate.html \
asearchtemplate.html \
csstemplate.css \
listtemplatefooter.html \
listtemplate.html \
rsstemplate.html \
singletemplate.html
cd ..
mv ${dir}${zipfile} .
done