Merge pull request #626 from dgswilkins/docker

Update Dockerfile to use supported version of alpine and Python
This commit is contained in:
Ryan L McIntyre 2021-11-26 18:19:01 -08:00 committed by GitHub
commit e2106fb47c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 15 deletions

View file

@ -1,4 +1,4 @@
FROM alpine:3.11
FROM alpine:edge
LABEL org.opencontainers.image.title="Nerd Fonts Patcher" \
org.opencontainers.image.description="Patches developer targeted fonts with a high number of glyphs (icons)." \
@ -6,8 +6,8 @@ LABEL org.opencontainers.image.title="Nerd Fonts Patcher" \
org.opencontainers.image.source="https://github.com/ryanoasis/nerd-fonts" \
org.opencontainers.image.licenses="MIT"
RUN apk add fontforge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing && \
apk add --no-cache py2-pip && \
RUN apk add --no-cache fontforge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing && \
apk add --no-cache py3-pip && \
pip install configparser
# sys.stdout.write encoding (py)

View file

@ -1,19 +1,24 @@
#!/bin/sh
skip=false
args=""
# Discard --out option
for i; do
[ "${i}" != "${i% *}" ] && i="\"$i\""
if [ "$i" = "--out" ] || [ "$i" = "-o" ]; then
skip=true
else
if [ "$skip" = false ] || [ "$i" == "-*" ]; then
args="$args $i"
fi
skip=false
fi
# 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
done
printf "Running with options:\n%s\n" "$args"
# shellcheck disable=SC2086
for f in /in/*.otf /in/*.ttf /in/*.woff /in/*.eot /in/*.ttc; do [ -f "$f" ] && fontforge -script /nerd/font-patcher -out /out $args "$f"; done