blob: f4ea50a2e67eca61672624c55c21c4fbe465aa29 (
plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
#!/bin/bash
set -e
cd "$(dirname "$0")/.."
OPT_HELP=
OPT_REVEAL_IN_FINDER=false
OUTFILE=
# parse args
while [[ $# -gt 0 ]]; do
case "$1" in
-h|-help|--help) OPT_HELP=0; shift;;
-reveal-in-finder) OPT_REVEAL_IN_FINDER=true; shift;;
-*)
echo "$0: Unknown option $1" >&2
OPT_HELP=1
shift
;;
*)
if [[ "$OUTFILE" != "" ]] && ! $OPT_HELP; then
echo "$0: Extra unexpected argument(s) after <outfile>" >&2
OPT_HELP=1
fi
OUTFILE=$1
shift
;;
esac
done
if [ -n "$OPT_HELP" ]; then
echo "Usage: $0 [options] <outfile>"
echo "Options:"
echo " -h, -help Show help."
echo " -reveal-in-finder After creating the zip file, show it in Finder"
exit $OPT_HELP
fi
# tmp dir
ZIPDIR=build/tmp/zip
# convert relative path to absolute if needed
OUTFILE_ABS=$OUTFILE
if [[ "$OUTFILE_ABS" != /* ]]; then
OUTFILE_ABS="$PWD/$OUTFILE_ABS"
fi
rm -rf "$ZIPDIR"
mkdir -p "$(dirname "$OUTFILE_ABS")" "$ZIPDIR"
cp LICENSE.txt "$ZIPDIR/LICENSE.txt"
mkdir -p "$ZIPDIR/Web"
cp misc/dist/help.txt "$ZIPDIR/help.txt"
cp build/fonts/static-hinted/Inter.ttc "$ZIPDIR/Inter.ttc"
cp build/fonts/var/InterV.var.ttf "$ZIPDIR/Inter Variable.ttf"
cp build/fonts/var/InterV-Italic.var.ttf "$ZIPDIR/Inter Variable Italic.ttf"
cp build/fonts/static/Inter-*.woff2 "$ZIPDIR/Web/" &
cp build/fonts/var/Inter.var.woff2 "$ZIPDIR/Web/InterVariable.woff2"
cp build/fonts/var/Inter-Italic.var.woff2 "$ZIPDIR/Web/InterVariable-Italic.woff2"
cp misc/dist/inter.css "$ZIPDIR/Web/"
. build/venv/bin/activate
python misc/tools/patch-version.py "$ZIPDIR/Web/inter.css"
mkdir -p "$ZIPDIR/extras/otf" \
"$ZIPDIR/extras/ttf" \
"$ZIPDIR/extras/woff with TT hints"
cp misc/dist/extras-readme.txt "$ZIPDIR/extras/README.txt"
cp build/fonts/static/Inter-*.otf "$ZIPDIR/extras/otf/" &
cp build/fonts/static-hinted/Inter-*.ttf "$ZIPDIR/extras/ttf/" &
cp build/fonts/static-hinted/Inter-*.woff2 "$ZIPDIR/extras/woff with TT hints/" &
mkdir -p "$(dirname "$OUTFILE_ABS")"
wait
rm -rf "$OUTFILE_ABS"
pushd "$ZIPDIR" >/dev/null
zip -q -X -r "$OUTFILE_ABS" *
popd >/dev/null
rm -rf "$ZIPDIR"
echo "Created $OUTFILE"
if $OPT_REVEAL_IN_FINDER && [ "$(uname -s)" = Darwin ] && [ -f /usr/bin/open ]; then
/usr/bin/open --reveal "$OUTFILE"
fi
|