2020-03-05 19:40:18 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-07-11 22:34:10 +02:00
|
|
|
set -e
|
|
|
|
|
2020-03-05 19:40:18 +02:00
|
|
|
args=""
|
|
|
|
|
2021-05-15 18:51:59 +02:00
|
|
|
# check all args for --out or -o
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
|
|
if [ "$1" = "-out" ] || [ "$1" = "--outputdir" ];then
|
|
|
|
# move past the option
|
|
|
|
shift
|
|
|
|
# and the value if there is one
|
|
|
|
case "$1" in
|
|
|
|
-*) continue ;;
|
|
|
|
*) shift $(( $# > 0 ? 1 : 0 )) ;;
|
|
|
|
esac
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
args="$args $1"
|
|
|
|
shift
|
2020-03-05 19:40:18 +02:00
|
|
|
done
|
|
|
|
|
2024-02-05 17:24:08 +02:00
|
|
|
if [ -z "$PN" ]; then
|
2024-02-05 19:17:20 +02:00
|
|
|
PN=0
|
2024-02-05 17:24:08 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
printf "Running with options:\n%s\nParallelism %s\n" "$args" "$PN"
|
2021-05-15 18:51:59 +02:00
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
2024-02-05 17:24:08 +02:00
|
|
|
find /in -type f \
|
2024-02-05 17:35:19 +02:00
|
|
|
\( -iname '*.otf' -o -iname '*.ttf' -o -iname '*.woff' -o -iname '*.eot' -o -iname '*.ttc' \) \
|
|
|
|
-print0 \
|
|
|
|
| parallel --verbose --null "--jobs=${PN}" fontforge -script /nerd/font-patcher -out /out $args {}
|
|
|
|
|
|
|
|
if [ -f font-patcher-log.txt ]; then
|
|
|
|
cp -f font-patcher-log.txt /out
|
|
|
|
fi
|
2023-07-11 22:34:10 +02:00
|
|
|
|
|
|
|
exit 0
|