1
1
mirror of https://github.com/rsms/inter.git synced 2024-12-26 17:12:35 +03:00
inter/docs/serve.sh

25 lines
570 B
Bash
Raw Normal View History

2017-08-22 10:05:20 +03:00
#!/bin/sh
set -e
cd "$(dirname "$0")"
2017-08-22 13:45:47 +03:00
if [ ! -s lab/fonts ]; then
ln -s ../../build/dist lab/fonts
fi
2017-08-22 10:05:20 +03:00
if (which caddy >/dev/null); then
caddy_args=(\
-host localhost \
"bind localhost" \
"mime .woff2 font/woff2" \
"mime .woff application/font-woff" \
)
caddy "${caddy_args[@]}"
elif (which servedir >/dev/null); then
servedir
else
echo "Can not find 'caddy' nor 'servedir' in PATH." >&2
echo "Install caddy from brew, apt or https://caddyserver.com/download"
echo "or install servedir with 'npm install -g secure-servedir'"
exit 1
fi