mirror of
https://github.com/daylinmorgan/monolisa-nerdfont-patch.git
synced 2024-12-22 06:50:44 -06:00
33 lines
602 B
Bash
Executable file
33 lines
602 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# set -e
|
|
# docker exits with code 1?
|
|
|
|
exts=(otf ttf woff woff2)
|
|
ext=$1
|
|
shift
|
|
fp_args=$@
|
|
|
|
if [[ -z $ext ]]; then
|
|
echo "please provide an extension"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ ! " ${exts[@]} " =~ " ${ext} " ]]; then
|
|
echo "$ext is not a valid extension"
|
|
echo "Please choose one of the below:"
|
|
printf '%s\n' "${exts[@]}"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Patching all fonts with ext -> $ext"
|
|
echo "Using the following arguments for font-patcher $fp_args"
|
|
|
|
docker run \
|
|
--rm \
|
|
-v "$(pwd)/MonoLisa/$ext:/in" \
|
|
-v "$(pwd)/patched/$ext:/out" \
|
|
-u "$(id -u):$(id -g)" \
|
|
nerdfonts/patcher \
|
|
$fp_arg
|
|
|
|
exit 0
|