-
Notifications
You must be signed in to change notification settings - Fork 2
/
generate-ctan.sh
executable file
·46 lines (36 loc) · 871 Bytes
/
generate-ctan.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
#!/usr/bin/env bash
#
# Generate a zip file suitable for uploading to CTAN.
#
# This script relies on the TDS directory having been made.
#
REMOVE_OUT=false
EXCLUDE_TDS=false
while getopts 'abf:v' flag; do
case "${flag}" in
RemoveOut) REMOVE_OUT=true ;;
ExcludeTds) EXCLUDE_TDS=true ;;
*) break ;;
esac
done
in="tdsout"
out="ctanout"
# We need the following files in the zip for ctan:
# - The class files
# - The style files
# - The docs (including the pdf versions)
# - The logos
# - The readme
# First, create the output directory
mkdir -p "$out/ugent2016"
find ${in} -type f -exec cp "{}" "$out/ugent2016" ";"
# Add tds-compliant zip file if necessary
if [[ ${EXCLUDE_TDS} = false ]]; then
cp ugent2016.tds.zip ${out}
fi
cd "$out" || exit
zip --filesync -r ../ugent2016.zip *
cd ..
if [[ "$REMOVE_OUT" = true ]]; then
rm -rf ${out}
fi