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" \ LABEL org.opencontainers.image.title="Nerd Fonts Patcher" \
org.opencontainers.image.description="Patches developer targeted fonts with a high number of glyphs (icons)." \ 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.source="https://github.com/ryanoasis/nerd-fonts" \
org.opencontainers.image.licenses="MIT" org.opencontainers.image.licenses="MIT"
RUN apk add fontforge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing && \ RUN apk add --no-cache fontforge --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing && \
apk add --no-cache py2-pip && \ apk add --no-cache py3-pip && \
pip install configparser pip install configparser
# sys.stdout.write encoding (py) # sys.stdout.write encoding (py)

View file

@ -1,19 +1,24 @@
#!/bin/sh #!/bin/sh
skip=false
args="" args=""
# Discard --out option # check all args for --out or -o
for i; do while [ "$#" -gt 0 ]; do
[ "${i}" != "${i% *}" ] && i="\"$i\"" if [ "$1" = "-out" ] || [ "$1" = "--outputdir" ];then
if [ "$i" = "--out" ] || [ "$i" = "-o" ]; then # move past the option
skip=true shift
else # and the value if there is one
if [ "$skip" = false ] || [ "$i" == "-*" ]; then case "$1" in
args="$args $i" -*) continue ;;
fi *) shift $(( $# > 0 ? 1 : 0 )) ;;
skip=false esac
continue
fi fi
args="$args $1"
shift
done 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 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