Makefile 1.05 KB
Newer Older
Mathieu Giraud's avatar
Mathieu Giraud committed
1 2 3 4
# Edit here - set path to you directory with config.json & fonts

FONT_DIR      ?= ./fontello/

5
retrieve:
6 7 8
	rm -rf "${FONT_DIR}"
	mkdir -p "${FONT_DIR}"
	cp config.json "${FONT_DIR}"
9 10
	make fontopen
	make fontsave
Mathieu Giraud's avatar
Mathieu Giraud committed
11 12 13

### Don't edit below ###

14
FONTELLO_HOST ?= https://fontello.com
Mathieu Giraud's avatar
Mathieu Giraud committed
15 16 17 18 19 20 21 22 23

fontopen:
	@if test ! `which curl` ; then \
		echo 'Install curl first.' >&2 ; \
		exit 128 ; \
		fi
	curl --silent --show-error --fail --output .fontello \
		--form "config=@${FONT_DIR}/config.json" \
		${FONTELLO_HOST}
24
	# x-www-browser ${FONTELLO_HOST}/`cat .fontello`
Mathieu Giraud's avatar
Mathieu Giraud committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39


fontsave:
	@if test ! `which unzip` ; then \
		echo 'Install unzip first.' >&2 ; \
		exit 128 ; \
		fi
	@if test ! -e .fontello ; then \
		echo 'Run `make fontopen` first.' >&2 ; \
		exit 128 ; \
		fi
	rm -rf .fontello.src .fontello.zip
	curl --silent --show-error --fail --output .fontello.zip \
		${FONTELLO_HOST}/`cat .fontello`/get
	unzip .fontello.zip -d .fontello.src
40 41
	rm -rf "${FONT_DIR}"
	mkdir -p "${FONT_DIR}"
42
	mv `find ./.fontello.src -maxdepth 1 -name 'fontello-*'`/* ${FONT_DIR}
Mathieu Giraud's avatar
Mathieu Giraud committed
43
	rm -rf .fontello.src .fontello.zip